restic.sh.example 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. # Make sure any previous values are cleared lol
  3. unset B2_ACCOUNT_ID B2_ACCOUNT_KEY RESTIC_REPOSITORY RESTIC_PASSWORD MUHRESTIC_OPTS MUHRESTIC_OPTS_BACKUP MUHRESTIC_OPTS_FORGET MUHRESTIC_BIN
  4. ### Necessary for restic to work, some Backblaze B2 params ;]
  5. # Application key ID
  6. export B2_ACCOUNT_ID='001111a111a1aa00000000001'
  7. # Application key
  8. export B2_ACCOUNT_KEY='K001aa1aaaa+aaaa1aaaa1aaaaaaa1a'
  9. # Repository URI, middle part is the bucket name and the last bit is the repo's root path inside of there
  10. export RESTIC_REPOSITORY='b2:muhbackup:/'
  11. # Repository pass obv lmao
  12. export RESTIC_PASSWORD='ayylmao'
  13. ### Custom shit ;]
  14. # Global arguments for restic command (supported by every subcommand)
  15. # Just check `restic --help` for more possible flags
  16. export MUHRESTIC_OPTS='--verbose --cache-dir=/backup/restic-cache -o b2.connections=10'
  17. # Specific to `restic backup`
  18. export MUHRESTIC_OPTS_BACKUP='--exclude-caches'
  19. # Also for `restic forget`
  20. # Do not specify --keep-daily here, as we already use that with $MUHBACKUP_RETENTION_DAYS (conf/backup.sh)
  21. # Also do not specify --keep-last either, we already use that to make sure we always keep at least one "snapsh0t" (this is pr0lly redundant since restic seems to already do that automatically, but better to be extra safe ;])
  22. # Any other --keep-* flag should be fine though =]
  23. export MUHRESTIC_OPTS_FORGET=''
  24. # The full command lol (pr0lly don't touch imo tbh famlamlamla)
  25. export MUHRESTIC_BIN="restic $MUHRESTIC_OPTS"