Skip to content

Instantly share code, notes, and snippets.

@PHLAK
Last active March 30, 2019 07:02
Show Gist options
  • Save PHLAK/4ff4e89693084f495d4e63e2747aeee1 to your computer and use it in GitHub Desktop.
Save PHLAK/4ff4e89693084f495d4e63e2747aeee1 to your computer and use it in GitHub Desktop.
Restic Installation & Configuration

Install the pre-compiled Restic binary.

curl --silent --location https://github.com/restic/restic/releases/download/v0.9.4/restic_0.9.4_linux_amd64.bz2 | bzip2 --decompress \
| sudo tee /usr/bin/restic > /dev/null && sudo chmod +x /usr/bin/restic

Backup:

source /etc/restic/config && sudo -E restic backup --option b2.connections=10 --exclude-caches --exclude-file /etc/restic/excludes.list /home /etc

Cleanup:

restic forget --prune --host "${HOSTNAME}" --keep-last 3 --keep-hourly 24 --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --keep-yearly 1
export RESTIC_REPOSITORY=""
export RESTIC_PASSWORD=""
export B2_ACCOUNT_ID=""
export B2_ACCOUNT_KEY=""
# System Directories
########################################
/bin
/boot
/dev
/media
/mnt
/proc
/run
/snap
/sys
/tmp
/var/lib/docker
/var/log
/var/tmp
# User Files
########################################
/home/*/.cache
/home/*/.composer
/home/*/Downloads
/home/*/.fontconfig
/home/*/.npm
/home/*/.thumbnails
/home/*/.steam
/home/*/snap
# Disk Images
########################################
*.iso
*.qemu
*.qemu2
*.vbox
*.vmdk
# Cache Files
########################################
/**/cache
*.cache
# Development Files
########################################
/**/node_modules
/**/vendor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment