Skip to content

Instantly share code, notes, and snippets.

@MatthewVance
Created May 18, 2019 15:12
Show Gist options
  • Save MatthewVance/3295cad94771c57af66a8163a2ad1cba to your computer and use it in GitHub Desktop.
Save MatthewVance/3295cad94771c57af66a8163a2ad1cba to your computer and use it in GitHub Desktop.
Example bash shell script to return a list of Restic snapshots.
#!/bin/bash
#: Title : restic
#: Date : July 22 2018
#: Author : Matt Vance
#: Version : 1.0
#: Description : Script to fully sytem backlup
#: License : MIT License (MIT)
# Copyright (C) 2018 Matthew Vance
export RESTIC_REPOSITORY=/Volumes/storage/matt/backup/repos/shared/
export RESTIC_PASSWORD_FILE=/etc/restic/restic-pw.txt
# cacert is only needed if using REST with my own CA.
CACERT=/etc/restic/gryffindor-bundle.pem
CACHE=/home/restic/.cache
RESTIC=/usr/local/bin/restic
# Run Backups
$RESTIC snapshots \
--cacert $CACERT \
--cache-dir $CACHE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment