Advertisement
SemlerPDX

SaveBackup.bat ARK Survival Evolved World Backup Script

Apr 26th, 2017
547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.52 KB | None | 0 0
  1. REM  SaveBackup.bat
  2. REM  ARK Survival Evolved World Backup Script
  3. REM  by SemlerPDX May2017
  4. REM  
  5. REM  A manual or automatic script to backup the world save folder for ARK: Survival Evolved
  6. REM  Will only keep set maximum number of files, deleting oldest folders first
  7. REM  We have this on web panel button for server admins and it runs every 20 minutes on it's own
  8. REM  Great way to avoid losing data to bugs and making a rolling backup of player and world data
  9. REM  
  10. REM  Usage:
  11. REM  Change value of SAVEDARKSMAX to desired number of backups
  12. REM  Create folder called Backups in your ARK game/server folder at \ShooterGame\Saved\
  13. REM  Call this script from a web panel like TCAdmin or execute from a .bat
  14. REM  For .bat, save contents into root ARK game folder containing ShooterGame folder
  15. REM    **can easily be adapted for simple Minecraft server world backups as well**
  16.  
  17. @echo off
  18. echo Creating new backup...
  19. set SAVEDARKSMAX=4
  20. echo %DATE% %TIME%
  21.  
  22. for /f "tokens=1-9 delims=::./ " %%A in (
  23.   'echo %DATE% %TIME%'
  24. ) do (
  25.   set CURRENTDATETIME=SavedArks_%%B%%C%%D_%%E%%F%%G
  26. )
  27.  
  28. echo Copying SavedArks Folder to ShooterGame\Saved\Backups\%CURRENTDATETIME%...
  29. md .\ShooterGame\Saved\Backups\%CURRENTDATETIME%
  30. xcopy /e /k .\ShooterGame\Saved\SavedArks .\ShooterGame\Saved\Backups\%CURRENTDATETIME%
  31.  
  32. for /f "skip=%SAVEDARKSMAX% delims=" %%A in (
  33.   'dir ".\ShooterGame\Saved\Backups\*" /t:c /a:d /o:-d /b'
  34. ) do (
  35.   echo Deleting oldest World Save Backup: %%A...
  36.  
  37.   rd /s /q ".\ShooterGame\Saved\Backups\%%A"
  38. )
  39.  
  40. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement