MyBB Community Forums

Full Version: Cronjob
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone write me a very little, easy cronjob that starts a script (eggdrop.conf) at 10 pm and stops it again at 6 am, and this every day?

Thanks... =)
00 22-06 * * * * /home/directory/scripts/eggdrop.conf >/dev/null 2>&1
You need two crontab entries for that.
This should help you
http://www.unixgeeks.org/security/newbie...ron-1.html
Basically you would have to have your crontab entry to start it, and the script would have to have a check for a file such as .end_egg_drop... which would cause it to die out. Then your second crontab entry would just be a "touch .end_egg_drop" for the command, so the script would die out on the next loop. See the attached bash script for an example of how you can use "touched" files to cause the script to do different things.
(2010-12-19, 06:13 PM)Solidus Wrote: [ -> ]00 22-06 * * * * /home/directory/scripts/eggdrop.conf >/dev/null 2>&1

MmmmMm, I did forgot about some versions (most modern versions) of cron accepting ranges and lists of values for the fields as well. It used to only be Vixie cron, now its virtually all of them. Good call though. Good call.