T
tModLoader4y ago
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
ambitious-aqua4y ago
iirc no Probably only way is to send exit into its console
metropolitan-bronze
metropolitan-bronze4y ago
Timing command? crontab
extended-yellow
extended-yellowOP4y 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 tmux
ambitious-aqua
ambitious-aqua4y ago
probably
extended-yellow
extended-yellowOP4y ago
which activates a .tmux.conf file
new-session -d -s TMOD
set -g status off
new-window ~/tmod_server/start-tModLoaderServer.sh
new-session -d -s TMOD
set -g status off
new-window ~/tmod_server/start-tModLoaderServer.sh
yeah tmux send-keys works, I just couldn't figure out how to make it press enter
extended-yellow
extended-yellowOP4y ago
tmux send-keys -t TMOD say\ 'hello' Enter
No description

Did you find this page helpful?