Crontab time question
Hi,
Can someone tell me if it's possible to run a crontab script only on an odd or even minute? I need so split some jobs so that some run at 1:01, 1:03, etc., while the others run 1:02, 1:04, etc. Thanks, TWR |
You can get pretty close to it. First, install somewhere this script I just whipped up. Let's say it's at /bin/evenodd:
Code:
#!/bin/sh Code:
/usr/bin/whatever the chosen parameters Code:
/bin/evenodd even /usr/bin/whatever the chosen parameters Code:
/bin/evenodd odd /usr/bin/whatever the chosen parameters |
Yes, Check out the man pages for crontab. There is an example of how to run a script every other minute. Not trying to make this an RTFM answer but how to think and search first.
http://www.rt.com/man/crontab.5.html |
It wasn't so much a matter of every other minute (easy w/ */2 for minute column), but on even OR on odd minutes. Thank you, though, for the man pointer (I did look but in the wrong one). Here are two examples that do just what I want:
Code:
0-58/2 * * * * /bin/myscript |
All times are GMT -5. The time now is 04:07 PM. |