Skip to content

Instantly share code, notes, and snippets.

@wowaTYPO3
wowaTYPO3 / backup_home.sh
Created October 19, 2018 17:11 — forked from devm33/backup_home.sh
Bash script to backup home directories using rsync
#!/usr/bin/env bash
# Script to backup the home directory to an external hardrive mounted at /media/backup
# Uses rsync, dpkg, and mail (for error logging)
SRC='/home/wolfgang'
DEST='/home/wolfgang/Nextcloud/backups'
RSYNC_OPTS='-haAXuv --delete'
EXCLUDE='*/Trash/* */.cache/* */.thumbnails/* */.config/google-* lost+found .gvfs .putty/ Downloads/ Dropbox/ Nextcloud/ VirtualBoxVMs/'
EXCLUDE="$(echo $EXCLUDE | sed 's/\(\S\+\)/ --exclude \1/g')"