LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-13-2004, 12:16 AM   #1
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Rep: Reputation: 30
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.
 
Old 11-13-2004, 12:21 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
How about
daily && shutdown -h +3
then?

shutdown will only happen if daily succeeded.


Cheers,
Tink
 
Old 11-13-2004, 08:51 AM   #3
jeopardyracing
Member
 
Registered: Sep 2003
Posts: 175

Original Poster
Rep: Reputation: 30
Okay!

That works!
 
Old 11-13-2004, 01:56 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Pleasure :)


Cheers,
Tink
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shutdown only if no cron jobs are running Red Squirrel Linux - Software 4 08-31-2005 01:00 PM
Possible to combine kernels? JimBass Linux - Newbie 1 10-06-2004 05:52 PM
shutdown cron job tapanga Linux - Newbie 1 06-08-2004 12:17 PM
Best way to combine files? JockVSJock Programming 4 04-25-2004 07:38 PM
Is it possible to combine archives with ar? Griffon26 Linux - Software 2 07-02-2002 02:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration