Move restic backup info from notes to docs

This commit is contained in:
KemoNine 2020-08-01 00:06:14 +00:00
parent 914c05b501
commit ec8fb1b767
3 changed files with 61 additions and 45 deletions

View file

@ -13,3 +13,4 @@ This folder contains a bunch of general information on how to get the base of a
* [Slideshow Setup (REQUIRED)](slideshow.md)
* [Email Notifications (REQUIRED)](email_notifications.md)
* [cron / Scheduler (REQUIRED)](cron.md)
* [Backups via restic](restic.md)

60
docs/restic.md Normal file
View file

@ -0,0 +1,60 @@
# Backups via restic
The below commands will setup a **local** backup of your photo frame using ```restic```.
## Important Considerations
* ```restic``` can use a bit of memory, you'll want at least 2Gb of ram on your Raspberry Pi to use this setup
* This setup does **NOT** include photos as part of the backup to keep backup sizes down
* This seutp assumes you have cron setup and runs the backup at 0700 every day
## Setup
``` sh
########################################
# restic backups
########################################
pacman -S restic
btrfs subvolume create /tank/backup
restic init -r /tank/backup
cat > /root/restic_backup.sh <<EOF
#!/bin/bash
MACHINE=picture-frame
ZONE=root
export RESTIC_REPOSITORY=/tank/backup/
export RESTIC_PASSWORD=testing1234
/usr/bin/restic backup -v -q \
--tag $MACHINE --tag $ZONE \
/ \
--exclude /run \
--exclude /snapshots \
--exclude /tank \
--exclude /scratch \
--exclude /proc \
--exclude /sys \
--exclude /var/lib/schroot/mount \
--exclude /var/lib/docker \
--exclude /var/lib/lxcfs \
--exclude /mnt \
--exclude /root/.cache \
/usr/bin/restic forget -v \
--tag $MACHINE --tag $ZONE \
--keep-daily=7 \
--keep-weekly=4 \
--keep-monthly=12 \
--keep-yearly 1
# This can take a very, very long time
/usr/bin/restic prune && /usr/bin/restic check
EOF
chmod a+x /root/restic_backup.sh
crontab -e
0 7 * * * /root/restic_backup.sh
```

View file

@ -1,48 +1,3 @@
########################################
# restic backups
########################################
pacman -S restic
btrfs subvolume create /tank/backup
restic init -r /tank/backup
cat > /root/restic_backup.sh <<EOF
#!/bin/bash
MACHINE=picture-frame
ZONE=root
export RESTIC_REPOSITORY=/tank/backup/
export RESTIC_PASSWORD=testing1234
/usr/bin/restic backup -v -q \
--tag $MACHINE --tag $ZONE \
/ \
--exclude /run \
--exclude /snapshots \
--exclude /tank \
--exclude /scratch \
--exclude /proc \
--exclude /sys \
--exclude /var/lib/schroot/mount \
--exclude /var/lib/docker \
--exclude /var/lib/lxcfs \
--exclude /mnt \
--exclude /root/.cache \
/usr/bin/restic forget -v \
--tag $MACHINE --tag $ZONE \
--keep-daily=7 \
--keep-weekly=4 \
--keep-monthly=12 \
--keep-yearly 1
# This can take a very, very long time
/usr/bin/restic prune && /usr/bin/restic check
EOF
chmod a+x /root/restic_backup.sh
crontab -e
0 7 * * * /root/restic_backup.sh
########################################
# web based admin panel / dashboard / app
########################################