You are correct. I don't know who decided that those to fields should be combined with an OR, but I'd like to slap them with a herring. If they were combined with an AND what you are wanting would be trivial, and to get an OR would only require two entries (one for the DOM and one for the DOW). The way it was configured results in an impossible situation where a certain numbered weekday (first Tuesday, third Friay, etc.) cannot be described in cron. What you must do is call the script every Monday (for example) and then inside the script determine if the DOM is in the right date range (for example 1-7 for the first or 8-14 for the second week).
HTH Forrest |
I think you're right. However, you could get your script to run each Monday using the cron line like this:
Code:
0 9 * * 1 /home/hashbang/my_script.sh Code:
#!/bin/bash Code:
0 9 * * 1 RUNFROMCRON=yes /home/hashbang/my_script.sh Code:
#!/bin/bash |
Quote:
Code:
tty -s || exit Code:
test -t 0 || exit |
Quote:
|
Thanks for the responses here, I didn't see them before I settled on this...
Code:
* * * * 1 /home/hasbang/my_script.sh Code:
#!/bin/bash |
Hi there,
Just to add to this discussion. If you are like me, hashbangbinbash, and can never remember the rules of crontab. I write my cron file, then let "kcron" tell me about the set of rules I applied. Since you are using KDE, you should have access to "kcron" which will give you many details of the cron jobs you have registered. Cheers |
All times are GMT -5. The time now is 01:23 AM. |