Jun 13, 2006 #1 kozlow MIS Joined Mar 3, 2003 Messages 326 Location US I am trying to schedule a job to run every 45Minutes but am at a loss on how to accomplish. Any ideas?
I am trying to schedule a job to run every 45Minutes but am at a loss on how to accomplish. Any ideas?
Jun 13, 2006 #2 lpblauen Technical User Joined Dec 2, 2004 Messages 193 Location US do a crontab -e 45 * * * * /usr/bin/whatever >/dev/null 2>&1 Thats minutes hours dayofmonth month weekday command Upvote 0 Downvote
do a crontab -e 45 * * * * /usr/bin/whatever >/dev/null 2>&1 Thats minutes hours dayofmonth month weekday command
Jun 13, 2006 Thread starter #3 kozlow MIS Joined Mar 3, 2003 Messages 326 Location US That is 45 past the hour --- Every 60Minutes...... In the mean time, I am going to run every 40 Minutes Even Hour - 0,40 Odd Hour - 20 Upvote 0 Downvote
That is 45 past the hour --- Every 60Minutes...... In the mean time, I am going to run every 40 Minutes Even Hour - 0,40 Odd Hour - 20
Jun 13, 2006 #4 MadMichael Programmer Joined Sep 30, 2004 Messages 130 Location US Your cron pattern will look like this: Code: 00,45 0,3,6,9,12,15,18,21 * * * 30 1,4,7,10,13,16,19,22 * * * 15 2,5,8,11,14,17,20,23 * * * If you plot out the 45-minute intervals, you will see that the minutes-after-the-hour repeats every three hours. Code: 00:00 00:45 01:30 02:15 03:00 03:45 04:30 05:15 06:00 ...and so on... Upvote 0 Downvote
Your cron pattern will look like this: Code: 00,45 0,3,6,9,12,15,18,21 * * * 30 1,4,7,10,13,16,19,22 * * * 15 2,5,8,11,14,17,20,23 * * * If you plot out the 45-minute intervals, you will see that the minutes-after-the-hour repeats every three hours. Code: 00:00 00:45 01:30 02:15 03:00 03:45 04:30 05:15 06:00 ...and so on...
Jun 16, 2006 #5 mrn MIS Joined Apr 27, 2001 Messages 3,993 Location GB Like I said in the AIX forum (where you posted the same question) enter the following on the command line echo 0 > /tmp/count use vi to create the following script vi 45min.ksh count=`cat /tmp/count` if [ $count = "3" ] ; do whatever_command ((count += 1)) echo $count > /tmp/count done if [ $count = "3" ] ; do echo 0 > /tmp/count done fi Then run this every 15 minutes from cron 00,15,30,45 9-17 * * * 45min.ksh Mike "A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant." http://www.airport-parking-site.co.uk/ Upvote 0 Downvote
Like I said in the AIX forum (where you posted the same question) enter the following on the command line echo 0 > /tmp/count use vi to create the following script vi 45min.ksh count=`cat /tmp/count` if [ $count = "3" ] ; do whatever_command ((count += 1)) echo $count > /tmp/count done if [ $count = "3" ] ; do echo 0 > /tmp/count done fi Then run this every 15 minutes from cron 00,15,30,45 9-17 * * * 45min.ksh Mike "A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant." http://www.airport-parking-site.co.uk/