Skip to main content

Auto Simple Backups

Auto Backups

  • Will backup savefiles every 10 mintues with time stamp.

Linux

Make this file in home dir
  • mkdir backup
  • chmod 777 backup
  • nano pwbackup.sh
#!/bin/bash
rsync -avh "/home/pwserver/serverfiles/Pal/Saved/SaveGames/0/" "/home/pwserver/backup/$(date)/"
  • Add this line to crontab 
  • */10 * * * * /home/pwserver/pwbackup.sh > /dev/null 2>&1

https://crontab.guru/#*/10_*_*__ To change times

Windows

  • C:\serverfiles is the example of SteamCDM location
  • Make backup folder
  • Save this file C:\pwbackup.ps1 
  • Might need to run Set-ExecutionPolicy Unrestricted in powershell USE AT YOUR OWN RISK 

pwbackup.ps1 

$Time = Get-Date -Format "MM_dd_yy_HH_mm"
Copy-Item -Path "C:\serverfiles\Pal\Saved\SaveGames\0\" -Destination "C:\serverfiles\backup\$Time\" -Recurse
  • Open task Scheduler 
  • Right click and create basic task

image.png

  • Name pwbackup

image.png

  • Daily

image.png

  • Starts a 1/22/2024 12:00:00 PM

image.png

  • Start a program

image.png

  • Program/script: powershell
  • Add arguments  -File "C:\pwbackup.ps1"

image.png

  • Finish
  • Open task and set to repeat task every 10 minutes.

image.png

  • Close and right click Run to start.

image.png

Go to C:\serverfiles\backups and check files.