Re: Chron curiosity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Geoffrey Leach <geoff@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxxxx
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




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux