You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Crontab reboot command not working

Crontab reboot command not working

Greetings

I am new at this so excuse any ignorant mistakes I might be making.

I have a server (MM X.4.9) that I would like to restart every day in order to make sure no programmes are hanging etc. If a program is hanging is should force quit it. Using terminal I have entered the following command:

sudo nano /etc/crontab

Entered password

Than I entered using tab between each sequence:

15 13 1 1 * root reboot

This was a test run and it did not reboot.

Entering

cat /etc/crontab

I got:

# The periodic and atrun jobs have moved to launchd jobs
# See /System/Library/LaunchDaemons
#
# minute hour mday month wday who command
15 13 1 1 * root reboot


What have I done wrong?

Thanks

MBP, Mac OS X (10.4.9)

Posted on Jun 24, 2007 7:47 AM

Reply
Question marked as Top-ranking reply

Posted on Jun 24, 2007 8:08 AM

Hi ChangeAgent,
Use the absolute path, /sbin/reboot.
--
Gary
~~~~
No matter what other nations may say about the United States,
immigration is still the sincerest form of flattery.
9 replies

Jun 24, 2007 8:27 AM in response to Gary Kerbaugh

Just did that and no cigar.

Last login: Sun Jun 24 17:20:52 on ttyp1
Welcome to Darwin!
You have mail.
:~ e$ sudo nano /etc/crontab
:~ e$ sudo nano /etc/crontab
:~ e$ cat /etc/crontab
# The periodic and atrun jobs have moved to launchd jobs
# See /System/Library/LaunchDaemons
#
# minute hour mday month wday who command
25 17 1 1 1 * root /sbin/reboot

:~ e$

any other ideas?

Jun 25, 2007 12:59 AM in response to Gnarlodious

Thanks Gnarlodious

I understand, however I had left a Word document open on purpose with unsaved changes and it did not hang on it, it just shut Word down, on opening again (after restart) it showed a saved copy (auto safe) in the same way Word does if you force quit of crash. So it looks like it just pulls the plug. It also happened very fast, one moment the desktop the next moment a blue screen and out went the lights.

So what happened in the case of the Word programme?

Sincerely,

your humble Terminal apprentice.

Jun 25, 2007 12:46 PM in response to ChangeAgent

Hehe, there you are experimenting with a "reboot" cron command and you are surprised it quit so fast. You are not going to find a "graceful" solution to shutdown dialogs.

MSWord is a Java app, so it is especially important for the command to work that it doesn't get hung up on outer layers of the system. Especially stupid apps that use Java which is not well integrated. I believe Word has a 5 minute autosave, so you should be able to recover most of your document.

This reboot command should be running around 2AM, when the average webserver has minimum traffic. If you feel the need to reboot during busier times of the day, I'd suggest you look at what's causing your applications to crash.

Crontab reboot command not working

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.