Will the Shutdown command break anything?

atlantic

Explorer
Joined
Jan 9, 2020
Messages
52
Sorry, total noob question but is a cron job with 'Shutdown -p now' the right way to schedule shutting down the server every night? Will it cause damage to any of the datasets if they are being written to at the time?
 

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,448
That should be safe to use, our software uses a variation of that already.
 

atlantic

Explorer
Joined
Jan 9, 2020
Messages
52
Thanks Kris. Could you tell me if it waits for a process to finish or kills it asap? I'm assuming the latter, and if so is there an alternative command that waits for all write processes (ie backups, replications) to stop and then shutdown?
 

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,448
Both. It attempts a graceful shutdown of every process, however if something hangs too long it may force-kill it to complete the shutdown. This is fine in normal operations.
 

atlantic

Explorer
Joined
Jan 9, 2020
Messages
52
Nice. This was my only lead on diagnosing a corrupt time machine backup, so I need to do more digging. Thanks for the explanation.
 
Top