stash
stash copied to clipboard
Add documentation on how to pass optional arguments to `restic` backup/restore command
User can pass optional arguments to the restic backup/restore process via spec.target.args
field of BackupConfiguration/RestoreSession.
Pass args to restic backup command:
apiVersion: stash.appscode.com/v1beta1
kind: BackupConfiguration
metadata:
name: sample-deployment-backup
namespace: demo
spec:
repository:
name: deployment-backup-repo
schedule: "*/5 * * * *"
target:
ref:
apiVersion: apps/v1
kind: Deployment
name: sample-deployment
volumeMounts:
- name: source-data
mountPath: /source/data
paths:
- /source/data
args: ["--ignore-inode", "--tag=t1,t2"]
retentionPolicy:
name: "keep-last-5"
keepLast: 5
prune: true
Pass args to restic restore command:
apiVersion: stash.appscode.com/v1beta1
kind: RestoreSession
metadata:
name: sample-deployment-restore
namespace: demo
spec:
repository:
name: deployment-backup-repo
target:
ref:
apiVersion: apps/v1
kind: Deployment
name: sample-deployment
volumeMounts:
- name: source-data
mountPath: /source/data
rules:
- paths:
- /source/data/
args: ["--tag=t1,t2"]
very nice, it seems really flexible!
@hossainemruz Is this working for others? I tried to backup a PVC but I can see from my logs the parameter is not passed.
/bin/restic backup /stash-data --quiet --json --host host-0 --cache-dir /tmp/restic-cache --cleanup-cache
Sorry for late replay @aarononeal. You were right. It didn't worked for PVC backup. We have fixed the issue. Now, it should work.