Advertisement
Guest User

Untitled

a guest
Dec 30th, 2017
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. BACKUP_DIR=/home/steam/backup
  2. CURRENT_HOUR=$(date +"%H")
  3. CURRENT_DATE=$(date +"%F_%H")
  4. SERVER_PROCESS=$(ps axf | grep arma3server | grep -v grep)
  5. # CHECK SERVER IS RUNNING
  6. while [ ! -z "$SERVER_PROCESS" ]; do
  7. sleep 5
  8. echo "The server is still running!"
  9. SERVER_PROCESS=$(ps axf | grep arma3server | grep -v grep)
  10. done
  11. echo "The server is offline, the script is now started."
  12. # CHECK THE TIME FOR A BACKUP
  13. if [ "$CURRENT_HOUR" -eq 00 ] || [ "$CURRENT_HOUR" -eq 12 ]; then
  14. # ITS TIME FOR A BACKUP
  15. echo "A backup is created."
  16. mysqldump --user=root --password=alexm165 exile > $BACKUP_DIR/db_$CURRENT_DATE.sql
  17. zip -r $BACKUP_DIR/bu_$CURRENT_DATE.zip /home/steam/arma3/battleye /home/steam/arma3/mpmissions /home/steam/arma3/@ExileServer
  18. #BACKUP COMPLETE NOW RESTART THE SERVER
  19. screen -dmS ./arma3server -cfg=@ExileServer/basic.cfg -config=@ExileServer/config.cfg -autoinit -mod=@Exile\;@dino\;@ryanzombies\;@cba3\;@cupsu\;@cupsw\;@cupv\;@ebm -servermod=@ExileServer\; >> serverlog.rpt
  20. echo "Backup was created successfully, the server is now restarted."
  21. else
  22. # ITS NOT TIME FOR A BACKUP JUST RESTART
  23. echo "No backup is performed. The server is restarted."
  24. screen -dmS ./arma3server -cfg=@ExileServer/basic.cfg -config=@ExileServer/config.cfg -autoinit -mod=@Exile\;@dino\;@ryanzombies\;@cba3\;@cupsu\;@cupsw\;@cupv\;@ebm -servermod=@ExileServer\; >> serverlog.rpt
  25. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement