LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-16-2020, 04:15 AM   #16
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888

Quote:
Originally Posted by MadeInGermany View Post
ITYM
Code:
(/usr/bin/sleep 2 && reboot) &
2 seconds(!) is enough to ensure that the cronjob is finished when the reboot is run.
Correct, as the extra & at the end tells cron NOT to wait for it to finish.

But I still would use
- /sbin/shutdown -r +2m &
- always use a path in front of commands
as to save me the extra sleep command.
 
  


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
In a for loop that operates on multiple servers, need both the options to enter the password or to skip to next server in loop rajkamalhm Linux - Newbie 7 06-08-2016 09:28 PM
how to create a log file for a cronjob? hruday Linux - Newbie 3 06-11-2015 07:30 AM
Bash script issue (for loop inside a loop) Mperonen Programming 3 08-08-2013 02:14 AM
Create a Cronjob cefege Linux - Newbie 1 02-01-2012 06:44 AM
Set a cronjob to reboot a server every 3 days, to fix any problems abefroman Linux - Server 5 06-01-2010 01:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:26 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