Shutdown via Cron Job: switch is -p or -h?

Status
Not open for further replies.

panz

Guru
Joined
May 24, 2013
Messages
556
I'd like to shutdown my FreeNAS server every Monday at 3:00 a.m., so I setup a simple Cron Job like this:

User: Root

Command: shutdown -p now

Redirect Stdout: Checked

Redirect Stderr: Checked

The switch is -p or -h?
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
That is correct and how I set mine up.. I have to go back through all my cron jobs soon..
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
Note: If you don't run as root it will fail.. As well as many other crons that need root..
 

panz

Guru
Joined
May 24, 2013
Messages
556
I just tried from a SSH session: the -h switch doesn't power off the machine (as expected), so only the -p switch accomplishes the desired result.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
-h halts the box... -p power's off the box if the hardware supports ACPI.
 
Status
Not open for further replies.
Top