Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hossainemruz opened this issue Sep 29, 2021 · 3 comments

Comments

@hossainemruz
Copy link
Contributor

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"]
@zonca
Copy link

zonca commented Sep 29, 2021

very nice, it seems really flexible!

@aarononeal
Copy link

@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

@hossainemruz
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

3 participants