2022-05-19 13:56:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
sudo /usr/local/bin/restic self-update
|
|
|
|
sudo setcap cap_dac_read_search=+ep /usr/local/bin/restic
|
|
|
|
|
2024-10-02 13:07:32 +00:00
|
|
|
MACHINE=
|
2022-05-19 13:56:07 +00:00
|
|
|
ZONE=root
|
|
|
|
|
|
|
|
export RESTIC_REPOSITORY=
|
|
|
|
export RESTIC_PASSWORD=
|
|
|
|
|
|
|
|
/usr/local/bin/restic backup -v \
|
|
|
|
--tag $MACHINE --tag $ZONE \
|
|
|
|
/ \
|
|
|
|
--exclude=/dev \
|
|
|
|
--exclude=/run \
|
|
|
|
--exclude=/tank \
|
|
|
|
--exclude=/scratch \
|
|
|
|
--exclude=/proc \
|
|
|
|
--exclude=/sys \
|
|
|
|
--exclude=/var/lib/docker \
|
|
|
|
--exclude=/var/lib/lxcfs \
|
|
|
|
--exclude=/var/lib/containers \
|
|
|
|
--exclude=/mnt \
|
|
|
|
--exclude=/var/run \
|
|
|
|
--exclude=/tmp \
|
|
|
|
--exclude=/var/tmp
|
|
|
|
|
|
|
|
/usr/local/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/local/bin/restic prune && /usr/local/bin/restic check
|