# HG changeset patch # User Sean E. Russell # Date 1591739791 18000 # Tue Jun 09 16:56:31 2020 -0500 # Node ID 859d73550b00523ef91bf2a6639decd8c22a9f46 # Parent dc2f6aeb44d9c563b9e5b9fab84b80df198a57c8 Updated to include excludes, and instructions for installing as non-root diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -27,14 +27,32 @@ - /etc/backup - /etc/backup/environment - /etc/backup/paths +- /etc/backup/excludes - /lib/systemd/system/backup.service - /lib/systemd/system/backup.timer - /lib/systemd/system/backup-prune.service - /lib/systemd/system/backup-prune.timer -Steps ------ +Steps (as user) +--------------- + +If you want to back up your home directory as a user, you don't need to install all of this as root. The simple way is: + +``` +# Get this repository; say it lives in $PWD/restic-backup/ +mkdir .config/restic +cp restic-backup/{environment,paths,excludes} .config/restic/ +mkdir -p .config/systemd/user +cp restic-backup/backup*{service,timer} .config/systemd/user/ +# Edit environment, paths, and excludes appropriately +systemctl enable backup.timer +systemctl enable backup-prune.timer +``` + + +Steps (as root) +--------------- ### 1. Set up your Backblaze account diff --git a/backup.service b/backup.service --- a/backup.service +++ b/backup.service @@ -5,7 +5,7 @@ [Service] EnvironmentFile=/etc/backup/environment Type=simple -ExecStart=/usr/local/bin/restic backup --files-from ${FILES} --cache-dir ${RESTIC_CACHE_DIR} +ExecStart=/usr/local/bin/restic backup --files-from ${FILES} --exclude-file ${EXCLUDES} --cache-dir ${RESTIC_CACHE_DIR} --one-file-system [Install] WantedBy=multi-user.timer diff --git a/environment b/environment --- a/environment +++ b/environment @@ -3,6 +3,7 @@ RESTIC_REPOSITORY=b2:name-of-your-backup:restic RESTIC_PASSWORD="Really secure password goes here." RESTIC_CACHE_DIR=/var/cache/restic +EXCLUDES=/etc/backup/excludes FILES=/etc/backup/paths KEEP_DAILY=7 KEEP_MONTHLY=3