Advertisement
Capadillo

ark_backup_create.sh

Feb 9th, 2021
100
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. ##################################################
  4. #
  5. #
  6. # ARK: Survival Evolved Dedicated Server
  7. # Backup world saves to a specific folder.
  8. #
  9. # Source: youtube.com/watch?v=jEeTBQne27Y
  10. #
  11. #
  12. ##################################################
  13.  
  14. # Settings
  15. archive_prefix="Ark"
  16. save_from="/home/capadillo/servers/ark/ShooterGame/Saved/SavedArks"
  17. save_to="/home/capadillo/servers/backups"
  18.  
  19. # Construct the archive name.
  20. # Example: Ark_16.05.00_03.02.2021.tar.gz
  21. date=$(date +"_%H.%M.%S_%d.%m.%Y")
  22. archive_name="$archive_prefix$date.tar.gz"
  23.  
  24. # Stop ARK Server.
  25. systemctl stop ark
  26.  
  27. # Backup files using TAR.
  28. tar zcvf $save_to/$archive_name $save_from
  29.  
  30. # Run script to delete old backups.
  31. /home/capadillo/servers/commands/purge_backups.sh
  32.  
  33. # Start ARK Server
  34. systemctl start ark
Advertisement
RAW Paste Data Copied
Advertisement