Cron Jobs

Need help with an engine or coding not on the list? Need help with a game or the website and forums here? Direct all questions here.
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Cron Jobs

Post 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.
Image

Image
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Cron Jobs

Post 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.
The indelible lord of tl;dr
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: Cron Jobs

Post 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?
Image

Image
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Cron Jobs

Post 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.
The indelible lord of tl;dr
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: Cron Jobs

Post 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.
Image

Image
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: Cron Jobs

Post by Callan S. »

Can crons run a php script?
Fight Cycle : My latest Browser game WIP
Driftwurld : My Browser Game WIP
Philosopher Gamer : My Blog
User avatar
PaxBritannia
Posts: 680
Joined: Sun Apr 18, 2010 1:54 pm

Re: Cron Jobs

Post 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.
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Cron Jobs

Post 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!"
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Cron Jobs

Post by Jackolantern »

I will definitely think of crons that way from now on :)
The indelible lord of tl;dr
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Cron Jobs

Post by hallsofvallhalla »

haha figured it would have that affect.
Post Reply

Return to “Advanced Help and Support”