diff --git a/bin/Restic-Backup.ps1 b/bin/Restic-Backup.ps1 new file mode 100644 index 0000000..b659e70 --- /dev/null +++ b/bin/Restic-Backup.ps1 @@ -0,0 +1,33 @@ +# +# Create a Restic Backup +# + +param ( $action = "list" ) + +$env:RESTIC_REPOSITORY = "sftp:storagebox:/home/imac/restic" +$env:RESTIC_PASSWORD_FILE = "$PSScriptroot\restic-repo.txt" +Write-Host "Running in $PSScriptRoot with repo $env:RESTIC_REPOSITORY" + +function backup +{ + + restic backup -v --tag CarbonHome --exclude-caches --exclude-file="$PSScriptRoot\restic-exclude.txt" c:/Users/Heavy +} + +function forget +{ + restic --keep-daily 2 --keep-weekly 2 --keep-monthly 5 +} + +function list() +{ + restic ls latest +} + +switch($action) { + "backup" { backup } + "forget" { forget } + "list" { list } + "snapshots" { restic snapshots } + "stats" { restic stats } +}