LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Combine cron with shutdown? (https://www.linuxquestions.org/questions/linux-newbie-8/combine-cron-with-shutdown-254251/)

jeopardyracing 11-13-2004 12:16 AM

Combine cron with shutdown?
 
I'm considering adding the following bash alias to my bash profile to run at the end of a day's work on my HD Knoppix-powered dell laptop:

alias endday='daily; sleep 30; shutdown -h +3'

where 'daily' is actually another alias to run daily cron (I haven't bothered with setting up anacron.)

Question: if I do this, can I be sure that the daily cron will be completely run prior to the system running 'sleep 30 or 'shutdown'? ie do commands run like this run purely sequentially? I want to be sure the system won't begin a shutdown or save its user lockout file during the shutdown if cron is still running.

Tinkster 11-13-2004 12:21 AM

How about
daily && shutdown -h +3
then?

shutdown will only happen if daily succeeded.


Cheers,
Tink

jeopardyracing 11-13-2004 08:51 AM

Okay!
 
That works!

Tinkster 11-13-2004 01:56 PM

Pleasure :)


Cheers,
Tink


All times are GMT -5. The time now is 10:42 AM.