CritticAge
06-10-2002, 06:09 AM
I am posting this here because I need a some what quick reply. I have never used a cron, never needed to. What I need it to do is run a perl script every 15 mintues. Can this be done and how? Thanks.
![]() | View Full Version : CRON Help CritticAge 06-10-2002, 06:09 AM I am posting this here because I need a some what quick reply. I have never used a cron, never needed to. What I need it to do is run a perl script every 15 mintues. Can this be done and how? Thanks. Mdot 06-10-2002, 06:44 AM You need shell access. Write in shell "crontab -e" and put this line: 0,15,30,45,60 * * * * <PATH_TO_SCRIPT> then exit.. That's it. CritticAge 06-10-2002, 06:47 AM Thanks alot for that help, just one question though, why is the **** needed? Mdot 06-10-2002, 06:57 AM first value - 0,15,30... means what minute in a hour, so that 15,30 means every 15th and 30th min of hour second value * - hours - so that * means every hour third value - * - every day 4th - * - every week 5th - * - every year Hope it helps Jedito 06-10-2002, 07:11 AM you can also use */15 * * * * /path/to/file.pl CritticAge 06-10-2002, 07:15 AM 0,15,30,45,60 * * * * <PATH_TO_SCRIPT> Does it need the 0, wouldnt that be the same as 60? CritticAge 06-10-2002, 07:24 AM :( I am telling this stuff to my friend who has to do it for me, I am hosted with him. He says he only has access to a cron manager, these are his options: Minute: <INSERT WHATEVER> Hour: <INSERT WHATEVER> Day: <INSERT WHATEVER> Month: <INSERT WHATEVER> Weekday: <INSERT WHATEVER> Command: <INSERT COMMAND> Know what he should put in? Jedito 06-10-2002, 07:27 AM Try with this Minute: */15 Hour: * Day: * Month: * Weekday: * Command: /path/to/file.pl jamesc_CRNC 06-10-2002, 05:11 PM Originally posted by CritticAge Does it need the 0, wouldnt that be the same as 60? No, theoretically, the 60th minute does not exist, cause it starts at 0. 60 in this case would be useless. */15 * * * * <bleh> is more appropriate. CritticAge 06-10-2002, 05:38 PM Thanks alot, it works now :) Tazzman 06-10-2002, 05:42 PM So, if I read this right, to have a command run every 12 hours, it would be: * /12 * * * <PATH_TO_SCRIPT> And for a weekly backup something like: * * /7 * * <PATH_TO_SCRIPT> Would this work for coying directories with the cp command and with the mysqldump command? Looks far simpler than downloading one of those scripts for this... I just want to backup a few mySQL databases to a second harddrive every 12 hours and a few sites to the same harddrive every week and am trying to see what the easiest way would be to do this. bombino 06-11-2002, 01:11 AM Tazzman: Yes, Yes, and Yes. |