KetchupMonki

Starbound server auto shutdown bash

May 11th, 2016
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.34 KB | None | 0 0
  1. #!/bin/bash
  2. cd ~/steam/starboundsrv/giraffe_storage/
  3.  
  4. #Move old logs away
  5. find .  -maxdepth 1 | grep 'starbound_server.log.' | xargs -I{} mv {} oldlogs/
  6.  
  7. #If log was last modified over a couple of hours ago shut down the server
  8. if find . -maxdepth 1 -mmin +120 | grep 'starbound_server.log' ; then
  9.         screen -S sb -X stuff $'\003'
  10. fi
Advertisement
Add Comment
Please, Sign In to add comment