Auto shutdown and restart

MadMan3353

Dabbler
Joined
Apr 9, 2018
Messages
48
I have Truenas scale running on a z420 with 32gb ram and 3 pools. My scrub task and other task run over the weekend at night when no one using the the NAS. Is it possible to have the NAS auto shutdown Monday-Friday over night and wake up In the morning before people start to use the NAS? If possible how would I go about doing that?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
This has been asked before on the forums. Generically:
1. Shutdowns are easily accomplished with a cron job created under Tasks->Cron Jobs to run shutdown -h now daily from M-F.
2. Startups are trickier without an IPMI. For an HP Z420, the simplest is to have another system run a cron job M-F to send a wake on LAN packet to the Z420.
 

MadMan3353

Dabbler
Joined
Apr 9, 2018
Messages
48
This has been asked before on the forums. Generically:
1. Shutdowns are easily accomplished with a cron job created under Tasks->Cron Jobs to run shutdown -h now daily from M-F.
2. Startups are trickier without an IPMI. For an HP Z420, the simplest is to have another system run a cron job M-F to send a wake on LAN packet to the Z420.
What would be the command to set shutdown m-f at 11pm. Sorry never used corn before a little bit of is novice here.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
I forget the Scale UI doesn't have Tasks. You'll have to accomplish this from the API: midclt call cronjob.create '{ "user": "root", "command": "shutdown -h now", "description": "Shutdown M-F at 11 PM", "enabled": true, "schedule": { "minute": "0", "hour": "23", "dom": "*", "month": "*", "dow": "mon,tue,wed,thu,fri" } }'.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
Scale has cron jobs. System Settings / Advanced / Cron Jobs. A shutdown here is easy
 

MadMan3353

Dabbler
Joined
Apr 9, 2018
Messages
48
is this correct i changed the days to sunday-thursday

1658627180737.png
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Yes, you've got it.
 
Top