Using CronniX v3 to create a Cron job to reboot computer.

I have a blind server that I would like to shut down at lets say 10.15 PM.

If I set CronX up like follows 15/10/ /*/ with the command 'shutdown -r now' it should reboot every day at 10.15 AM, correct? well is does not. I set this up in a user with admin privileges.

I also tried:
15/10/ /*/ with the command 'sudo shutdown -r now'. same result, nothing.

If I run 'sudo shutdown -r now' in Terminal it works but asks for password. is this why it does not work in CronX? no password?

I also tried to access the System cron tabs in CroniX, but it reports there is no such user.

Any tips or help?

MBP, MM, MBP - 10.4 and 10.5 & hate to admit it Windooz on a hard partition

Posted on Nov 1, 2008 1:49 AM

Reply
9 replies

Nov 1, 2008 6:52 AM in response to ChangeAgent

I set this up in a user with admin privileges.

Not good enough.

You need to set up the root crontab entry.

sudo crontab -e

By default this is going to bring up the vi editor. If you do not know how to use vi, then try:

export EDITOR=/usr/bin/nano
sudo crontab -e

where the nano editor is a much simplier editor, but will do the job.

Message was edited by: BobHarris

Nov 1, 2008 8:40 AM in response to ChangeAgent

any idea how to do this in CronniX?

Cronnix -> File -> Open for User... -> root

You should then be prompted for your Admin Password.

Now update the root crontab entry.

But just to be sure things are really working. Add a test entry with the following:

* * * * * date >/tmp/date.cron
* * * * * printenv >/tmp/printenv.cron

wait a minute or 2 so that cron has had a chance to execute the jobs, then look for /tmp/date.cron and /tmp/printenv.cron

If the files have been created and the contents look OK (printenv will be very short), then REMOVE the test entries, because you *DO NOT* want cron running every minute to re-create those files.

If you are not a Terminal kind of person, then use
Finder -> Go -> Go to folder... -> /tmp

Nov 1, 2008 10:59 AM in response to BobHarris

Hi Bob,

So far so good, till I made a mistake.

all your suggested tests worked. than I made a mistake, I set a reboot command in the root cron and set it at every minute, hit safe and had no time to correct.

can I throw a file away somewhere? or do I need to go in at the start over command S and than do something. I am in over my head as you can imagine and hoping for your help.

thanks.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Using CronniX v3 to create a Cron job to reboot computer.

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