#!/usr/bin/env bash
RDIFF=rdiff-backup

# first two arguments are source and destintation
SOURCE=${1}
DEST=${2}

# configuration options
VERBOSITY=5
KEEP_FOR=3M

echo "Backing up '${SOURCE}' to '${DEST}'..."
${RDIFF} \
  --exclude '/tmp/*' \
  --exclude '/proc/*' \
  --exclude '/sys/*' \
  --exclude '/mnt/*/*' \
  --exclude-special-files \
  --exclude-other-filesystems \
  --verbosity "${VERBOSITY}" \
  "${SOURCE}" "${DEST}"

echo "Purging old backups in '${DEST}'..."
${RDIFF} \
  --remove-older-than "${KEEP_FOR}" \
  --force \
  --verbosity "${VERBOSITY}" \
  "${DEST}"

#!/usr/bin/env bash
RDIFF=rdiff-backup

# always backup the root system
SOURCE='/'

# only argument is the destination
DEST=${1}

# configuration options
VERBOSITY=5
KEEP_FOR=3M

echo "Backing up '${SOURCE}' to '${DEST}'..."
echo

${RDIFF} \
  --exclude '/home/*/.cache' \
  --include '/home' \
  --exclude '/tmp/*' \
  --exclude '/proc/*' \
  --exclude '/sys/*' \
  --exclude '/mnt/*/*' \
  --exclude-special-files \
  --exclude-other-filesystems \
  --verbosity "${VERBOSITY}" \
  "${SOURCE}" "${DEST}"

echo
echo "Purging old backups in '${DEST}'..."
echo

${RDIFF} \
  --remove-older-than "${KEEP_FOR}" \
  --force \
  --verbosity "${VERBOSITY}" \
  "${DEST}"

Include home folder, remove first argument
Include home folder, remove first argument

The first argument is unceccesary since we'll always be backing up the entire
system.

The home folder wasn't being included before since it was on a separate drive.
This forces it to be included regardless of where its located.
