On Wednesday 04 August 2004 20:19, Doug Currey wrote:
On Wed, 4 Aug 2004 20:04:45 +0200, Anders Johansson wrote
On Wednesday 04 August 2004 19:50, Doug Currey wrote:
How about the following in crontab
* */18 * * * someuser /usr/local/bin/script > /dev/null
This should execute 'script' every 18 hours as user someuser
No, that will execute it 60 times between midnight and 1am, and 60 times between 6pm and 7pm each day
Are you sure about that?
Yes
From the crontab(5)
Step values can be used in conjunction with ranges. Following a range with `/' specifies skips of the number's value through the range. For example, `0-23/2' can be used in the hours field to specify command execution every other hour (the alternative in the V7 standard is `0,2,4,6,8,10,12,14,16,18,20,22'). Steps are also permitted after an asterisk, so if you want to say `every two hours', just use `*/2'.
Indeed, so */18 is the same as stepping from 0 to 23 with a step of 18. In other words, */18 is equivalent to 0,18. The actual code in cron is for (i = num1; i <= num2; i += num3) if (EOF == set_element(bits, low, high, i)) return EOF; In this case, num1 is 0, num2 is 23 and num3 is 18 Also note the "60 times" remark. You had * for the minute field, which means it will execute once per minute every minute in the hour given