aboutsummaryrefslogtreecommitdiff
path: root/hourly-backup.sh
blob: c30144857dcc15ea704c436f1e0b54328a8c88d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
#
# This script will rsync the entire filesystem to /mnt/backup/live/ 
# This script assumes /mnt/backup/live/ is where we want to backup files
#
# My personal setup:
#   -- has this running hourly with cron
#   -- mounts /mnt/backup to it's own specific NFS share configured for the host
# 
# !! WARNING SLOW FIRST RUN !!
# the first run will be slow so run this first before setting up the hourly job

rsync -aAXH \
  --exclude /dev/ \
  --exclude /proc/ \
  --exclude /sys/ \
  --exclude /tmp/ \
  --exclude /usr/tmp/ \
  --exclude /run/ \
  --exclude /mnt/ \
  --exclude /media/ \
  --exclude /var/cache/ \
  --exclude lost+found/ \
  --exclude /var/log/journal \
  --exclude /var/lib/systemd/random-seed
  /* /mnt/backup/live/ --delete