T
extended-yellow
Shutdown linux server automatically at certain time
I use a headless server and I've been using tmux to ssh into the machine, run the server, and then detach from tmux so I can keep it running in the background. I've set it up so that tmux automatically starts up on the server and the tmod server automatically starts up in that tmux session.
Is there a way to shutdown the server automatically at certain times of the day, such as 11:00 PM?
6 Replies
ambitious-aqua•4y ago
iirc no
Probably only way is to send
exit into its consolemetropolitan-bronze•4y ago
Timing command?
crontab
extended-yellowOP•4y ago
yeah, but the problem is sending the exit into the console
do you think I could use something like tmux's
send-keys?
my crontab is @reboot tmuxambitious-aqua•4y ago
probably
extended-yellowOP•4y ago
which activates a .tmux.conf file
yeah tmux send-keys works, I just couldn't figure out how to make it press enter
extended-yellowOP•4y ago
tmux send-keys -t TMOD say\ 'hello' Enter