![]() |
Schedule a command for twice daily with cron?
OK, I have a very quick question. I have Logwatch running once a day with cron, how do I set it up to run twice a day?
|
Code:
30 6,15 * * * somecommand.sh |
just put two values in the second column, e.g. "0 3,15 * * * command" would run at 3am and 3pm
|
OK, I took the 0logwatch script from /etc/cron.daily and I put in a new directory called /etc/cron.twice_daily.
Then I added "0 5,17 * * * root run-parts /etc/cron.twice_daily" in my crontab and restarted cron. That should work, right? This is the first time I've ever really used cron. Thanks for the help. |
yub, so at 5:00AM and 5PM your going to run ;)
|
Excellent :)
|
Does "*/12" work?
Can't you use "*/12" to mean "every 12 hours"?
|
yes, but he wanted 5pm, not midnight and noon.
Note this thread is SEVEN YEARS OLD. The specific question is no longer relevant. |
| All times are GMT -5. The time now is 05:06 PM. |