Re: Chron curiosity
Am 28.06.2013 21:41, schrieb Tom Horsley: > On Fri, 28 Jun 2013 12:25:02 -0700 > Wolfgang S. Rupprecht wrote: > >> Look at the top of /etc/cron.hourly/0anacron > > Speaking of anacron, you may want to eradicate all the > anacron junk if you actually want jobs to run at the > times you specified rather than at random times > anacron picks to be as inconvenient as possible *no* you can configure it to *not* use random times and then you can be sure that the system is aware that a job did run the random-default is perfectly for most environments especially if you are in the world of virtualization __ # /etc/anacrontab: configuration file for anacron # See anacron(8) and anacrontab(5) for details. SHELL=/usr/bin/bash PATH=/usr/sbin:/usr/bin MAILTO=root # the maximal random delay added to the base delay of the jobs RANDOM_DELAY=5 # the jobs will be started during the following hours only START_HOURS_RANGE=0-12 #period in days delay in minutes job-identifier command 1 5 cron.daily nice -n 19 run-parts /etc/cron.daily 7 25 cron.weekly nice -n 19 run-parts /etc/cron.weekly @monthly 45 cron.monthly nice -n 19 run-parts /etc/cron.monthly signature.asc Description: OpenPGP digital signature -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
Re: Chron curiosity
On Fri, 28 Jun 2013 12:25:02 -0700 Wolfgang S. Rupprecht wrote: > Look at the top of /etc/cron.hourly/0anacron Speaking of anacron, you may want to eradicate all the anacron junk if you actually want jobs to run at the times you specified rather than at random times anacron picks to be as inconvenient as possible. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
Re: Chron curiosity
Geoffrey Leach writes: > I have this line in /etc/crontab: > > 30 23 * * * geoff /usr/local/bin/fp.pl > > which executes the program every day at 2330. The script terminates by > executing system 'sudo systemctl start poweroff.target'; > > Generally this works as expected. > > However, when I realize that the shutdown happened too soon, and I > restart the system, it re-executes the script. > > Any suggestions as to where I've gone wrong? You didn't wait a minute for before restarting the computer? ;-) Look at the top of /etc/cron.hourly/0anacron and add logic just like this to your script. Cron is stateless across reboots (as far as I know) and has no way to tell if it already ran. You have to record that fact yourself. -wolfgang -- g+: https://plus.google.com/114566345864337108516/about -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
Chron curiosity
I have this line in /etc/crontab: 30 23 * * * geoff /usr/local/bin/fp.pl which executes the program every day at 2330. The script terminates by executing system 'sudo systemctl start poweroff.target'; Generally this works as expected. However, when I realize that the shutdown happened too soon, and I restart the system, it re-executes the script. Any suggestions as to where I've gone wrong? Thanks. -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org