stash icon indicating copy to clipboard operation
stash copied to clipboard

Add documentation on how to pass optional arguments to `restic` backup/restore command

Open hossainemruz opened this issue 3 years ago • 3 comments

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"]

hossainemruz avatar Sep 29 '21 09:09 hossainemruz

very nice, it seems really flexible!

zonca avatar Sep 29 '21 16:09 zonca

@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

aarononeal avatar Feb 20 '22 22:02 aarononeal

Sorry for late replay @aarononeal. You were right. It didn't worked for PVC backup. We have fixed the issue. Now, it should work.

hossainemruz avatar Jul 25 '22 09:07 hossainemruz