Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # A simple PowerShell script to backup SCUM single player save file
- # Twitter: @Kerbo_
- #
- $scumDir = $env:LOCALAPPDATA + "\SCUM\Saved\SaveFiles"
- $dateString = $(get-date -f yyy-MM-dd_HH-mm)
- Push-Location $scumDir
- $backup = gci SCUM-2* | select -last 1
- $backup_hash = Get-FileHash $backup
- $scumdb = Get-Item SCUM.db
- $scumdb_hash = Get-FileHash $scumdb
- #Write-Host "$backup : $backup_hash"
- #Write-Host "$scumdb : $scumdb_hash"
- if ( $backup_hash.Hash -eq $scumdb_hash.Hash ) {
- Write-Host "SCUM.db matches latest backup, no backup needed" -ForegroundColor green
- } else {
- cp SCUM.db SCUM-$dateString.db
- $RET=$?
- if ($RET) {
- Write-Host "Copied SCUM.db to SCUM-$dateString.db" -ForegroundColor yellow
- } else {
- Write-Host "Error! cp returned $RET" -ForegroundColor red
- }
- }
- Pop-Location
- Start-Sleep -Seconds 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement