Reboot script not working

wang1zhen

Cadet
Joined
Dec 17, 2020
Messages
9
Hi, this could be some sort of newbie question, but I have no idea why it did not work.

I've set up a reboot script for my truenas, as you can see it should reboot my machine every day at 3:00 am:

1612076029600.png


when I first set it, everything's working fine, but sometimes it fails, and for days it won't reboot until I do it manually.

What's more, if I click the 'RUN NOW' in webUI, which should run the script, my truenas does not reboot; while if I type `reboot now` in the Terminal, it does.

I guess there might be some process stuck? This is not quite critical but rather annoying, would be glad if someone could help me out. Thanks in advance!
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You see that you typed "shutdown" not reboot, right?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703

wang1zhen

Cadet
Joined
Dec 17, 2020
Messages
9
You appear to be giving evidence that there's a different way that works... why aren't you using it?
Sorry for the misunderstanding, actually I tried `shutdown -r now` in the terminal and it worked. So I do not think it should be a problem of the `shutdown` or `reboot` command.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Why are you rebooting your server every day? You're losing the benefit of ZFS caching by doing so.
 

wang1zhen

Cadet
Joined
Dec 17, 2020
Messages
9
Why are you rebooting your server every day? You're losing the benefit of ZFS caching by doing so.
Yeah, I am aware of that, yet I simply do not trust my devices that much, thus I would rather reboot them every day.
 

wang1zhen

Cadet
Joined
Dec 17, 2020
Messages
9
Can anyone help or tell me what i could do to provide more info about this rebooting issue?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Typically, this is a path error. For cron jobs, it's good practice to specify the full path of the command: /sbin/reboot or /sbin/shutdown.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Top