schedule server restart

SeeYouu

Cadet
Joined
May 5, 2020
Messages
5
Hello everybody,
I come to you for a little suptility that I don't have?
I would like to schedule a full restart of my server at a specific time.
So I was in the "cron" to create my task. except that now I am really annoying, because I have no idea of the command to be desired to execute this task.
I tried to search for the order on the internet and the few people who talk about it are more in stopping the server than in restarting.
Thank you in advance for your help.
 

LtHaus

Dabbler
Joined
Apr 21, 2020
Messages
31
man shutdown.

From real old memroy you could either write a script or put the command. shutdown -r now ISH. Again from memory so Man shutdown and be sure I'm not out in the dark...

(my box is down or I would provide a more precise answer... )
 

SeeYouu

Cadet
Joined
May 5, 2020
Messages
5
Thanks for your reply, but I don't want my server to stop.
I just want him to reboot.
 

SeeYouu

Cadet
Joined
May 5, 2020
Messages
5
Sorry I just tested your order and indeed it works well for a restart.
Thank you for your reply.
 

LtHaus

Dabbler
Joined
Apr 21, 2020
Messages
31
-h would Halt it. You bet! I'm sure there is a more better way, but the shutdown -r should run the safe shutdown scripts.
If memory serves right.
 

Matt.b483

Dabbler
Joined
Dec 15, 2020
Messages
14
shutdown -r now

https://www.freebsd.org/cgi/man.cgi?query=shutdown&sektion=8&manpath=freebsd-release-ports

I have to ask, why do you want to reboot your server on a schedule?
for me it seems that if I don't restart the server once a week, the shared files are no longer available and the gui login gives me the generic truenas error, cant connect are you sure the server is online(wording my be off a bit), and the only way to regain connection to the server is using ssh to do a manual reboot. so setting up a weekly reboot on Sundays should fix the issue until I figure out what is causing it.
 

hescominsoon

Patron
Joined
Jul 27, 2016
Messages
456
for me it seems that if I don't restart the server once a week, the shared files are no longer available and the gui login gives me the generic truenas error, cant connect are you sure the server is online(wording my be off a bit), and the only way to regain connection to the server is using ssh to do a manual reboot. so setting up a weekly reboot on Sundays should fix the issue until I figure out what is causing it.
then you have something not right. you should not have to reboot..except for upgrades..at all. what are your full system specs?
 
Top