(restic): Add powershell script for restic backup.
This commit is contained in:
parent
183884c77e
commit
385d3cae43
33
bin/Restic-Backup.ps1
Normal file
33
bin/Restic-Backup.ps1
Normal file
@ -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 }
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user