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
- Name
pwbackup
- Daily
- Starts a 1/22/2024 12:00:00 PM
- Start a program
- Program/script:
powershell
- Add arguments
-File "C:\pwbackup.ps1"
- Finish
- Open task and set to repeat task every 10 minutes.
- Close and right click Run to start.
Go to C:\serverfiles\backups and check files.