daily pastebin goal
11%
SHARE
TWEET

Untitled

a guest Oct 21st, 2018 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. cd /home/mco/minecraft
  3. screen -p 0 -X stuff "`printf "say Starting daily backup, server will be restarted on backup completion.\r"`"
  4. sleep 1
  5. screen -p 0 -X stuff "`printf "stoplag\r"`"
  6. sleep 1
  7.  
  8. T="$(date +%s)"
  9. screen -p 0 -X stuff "`printf "save-all\r"`"
  10. sleep 2
  11. screen -p 0 -X stuff "`printf "save-off\r"`"
  12. sleep 1
  13.  
  14. rdiff-backup --force --remove-older-than 1W backup/Oblivion
  15. rdiff-backup --no-compression plugins/ backup/plugins
  16. rdiff-backup --force --remove-older-than 1W backup/plugins
  17.  
  18. D="$(date +%y-%m-%d)"
  19.  
  20. mv server.log server.${D}.log
  21. touch server.log
  22.  
  23. T="$(($(date +%s)-T))"
  24. screen -p 0 -X stuff "`printf "save-on\r"`"
  25. sleep 1
  26. screen -p 0 -X stuff "`printf "save-all\r"`"
  27. sleep 2
  28.  
  29. screen -p 0 -X stuff "`printf "say Daily backup complete.  Completed in ${T}s. Restarting!\r"`"
  30. sleep 2
  31. screen -p 0 -X stuff "`printf "kickall Server Restart\r"`"
  32. screen -p 0 -X stuff "`printf "stop\r"`"
  33.  
  34. exit $?
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top