Page 1 of 4

Cron Jobs

Posted: Wed Jun 02, 2010 1:41 am
by SpiritWebb
Hey guys, I really need some help here!

I have setup a php file, to keep track of things that we do at work. (Work in a data center). I am needing to know how to write a cron job or equivalent for WAMP on Windows XP Pro that will auto backup the entire database and entire internal website everyday at around noon, or even twice a day at noon and midnight. (keep in mind there are multiple databases. One for metrics, another for turnover and finally one for rotations. The cron has to be able to backup the entire MySQL and internal website, everything. It is crucial, or we cannot move forward on this project).

I want this job to save it too a thumb drive, so in case the computer crashes, it is backed up to the thumb drive where it is safe. I do not know how to do this kind of thing...and any help would be greatly appreciated.

Re: Cron Jobs

Posted: Wed Jun 02, 2010 5:19 am
by Jackolantern
This may help out, as it discusses an open source tool that lets you automatically backup MySQL databases. And here is a list of 10 different ways to automatically and manually back-up MySQL databases.

Re: Cron Jobs

Posted: Wed Jun 16, 2010 5:05 am
by SpiritWebb
I am still confused on how to write a cron job and get it to implement and work with WAMP. This is very important, I have no idea how to do this...


I am also wondering if there is a way to have it auto email and the end of the month a dump of each table, then backup the entire database and start new for a new month. So each month is backed up to a flash drive? Any ideas if this is possible?

Re: Cron Jobs

Posted: Wed Jun 16, 2010 8:12 am
by Jackolantern
Crons are not part of PHP. They are a part of Linux, so they cannot be used in WAMP. You can look for resources on how to set up a scheduled event in Windows, as there are several different ways. You could also test all of your non-cron scripts on WAMP and just test cron work on a free Linux web host that supports them.

Re: Cron Jobs

Posted: Sat Jun 26, 2010 3:12 am
by SpiritWebb
Windows can do cron jobs, they are just a little different. Instead of cron its at.

See http://realm3.com/articles/how_to_sched ... in_windows on how to complete it.

Re: Cron Jobs

Posted: Sat Jun 26, 2010 10:44 am
by Callan S.
Can crons run a php script?

Re: Cron Jobs

Posted: Sat Jun 26, 2010 1:04 pm
by PaxBritannia
Crons are basically telling the computer to go to the site when you tell it to. It then normally runs an administrative script.

So yes, you can. That's the whole point of a cron.

Pax.

Re: Cron Jobs

Posted: Sat Jun 26, 2010 1:27 pm
by hallsofvallhalla
think of a cron as the little asian kid(no racism intended) in Indiana Jones.

You tell him "Shorty! I need you to go to this internet page at exactly 10:00am everyday!"
he say "Yes Indy!"

thats it! nothing complicated to it. It is just like opening up a browser and running the page...nothing more! Linux is your little shorty. You tell him to open the page and he does and replies "No time for love Indy, we got to go!"

Re: Cron Jobs

Posted: Sat Jun 26, 2010 4:23 pm
by Jackolantern
I will definitely think of crons that way from now on :)

Re: Cron Jobs

Posted: Sat Jun 26, 2010 7:17 pm
by hallsofvallhalla
haha figured it would have that affect.