carlsson macrumors 6502a Original poster Jul 18, 2001 600 521 Nov 29, 2014 #1 I want my old server to restart itself every night. So I edited the Crontab, added this: 40 3 * * * shutdown -r now Still, it won't restart. What am I doing wrong? Is there a simpler way to make the Mac restart every night?
I want my old server to restart itself every night. So I edited the Crontab, added this: 40 3 * * * shutdown -r now Still, it won't restart. What am I doing wrong? Is there a simpler way to make the Mac restart every night?
carlsson macrumors 6502a Original poster Jul 18, 2001 600 521 Nov 29, 2014 #2 Hmmm, I changed the command to /sbin/shutdown -r now ...and now it works. It was not shut down gracefully though. :-|
Hmmm, I changed the command to /sbin/shutdown -r now ...and now it works. It was not shut down gracefully though. :-|
S ScoobyMcDoo macrumors 65816 Nov 26, 2007 1,188 37 Austin, TX Nov 30, 2014 #3 Instead of the shutdown command, try this: Code: osascript -e 'tell app "System Events" to restart' It works from the command line, but haven't tried it from a cron job.
Instead of the shutdown command, try this: Code: osascript -e 'tell app "System Events" to restart' It works from the command line, but haven't tried it from a cron job.
carlsson macrumors 6502a Original poster Jul 18, 2001 600 521 Nov 30, 2014 #4 Thanks Scooby. However, the shutdown -r function works now with crontab and it all seems okey. I just want to confirm that the reboot is a graceful one. Do you know?
Thanks Scooby. However, the shutdown -r function works now with crontab and it all seems okey. I just want to confirm that the reboot is a graceful one. Do you know?
S ScoobyMcDoo macrumors 65816 Nov 26, 2007 1,188 37 Austin, TX Dec 2, 2014 #5 carlsson said: Thanks Scooby. However, the shutdown -r function works now with crontab and it all seems okey. I just want to confirm that the reboot is a graceful one. Do you know? Click to expand... It is clean as far as the OS is considered. However I think the method I told you about will more safely shutdown a logged in session. For example, the shutdown -r will reboot even if you have a document opened an not saved.
carlsson said: Thanks Scooby. However, the shutdown -r function works now with crontab and it all seems okey. I just want to confirm that the reboot is a graceful one. Do you know? Click to expand... It is clean as far as the OS is considered. However I think the method I told you about will more safely shutdown a logged in session. For example, the shutdown -r will reboot even if you have a document opened an not saved.