diff options
| author | benj <benj@rse8.com> | 2026-04-01 22:14:57 +0800 |
|---|---|---|
| committer | benj <benj@rse8.com> | 2026-04-01 22:14:57 +0800 |
| commit | 511733d2e11566bd85dec9728403baff3ad2e62b (patch) | |
| tree | f0fd1d6c7ffc2a590eb934672be19fe8b2b19417 /backup/ad3/backup-cloud | |
| parent | dd6884a7e290bfedf94ba8c8088ace6df43af02a (diff) | |
| download | mycfg-511733d2e11566bd85dec9728403baff3ad2e62b.tar mycfg-511733d2e11566bd85dec9728403baff3ad2e62b.tar.gz mycfg-511733d2e11566bd85dec9728403baff3ad2e62b.tar.bz2 mycfg-511733d2e11566bd85dec9728403baff3ad2e62b.tar.lz mycfg-511733d2e11566bd85dec9728403baff3ad2e62b.tar.xz mycfg-511733d2e11566bd85dec9728403baff3ad2e62b.tar.zst mycfg-511733d2e11566bd85dec9728403baff3ad2e62b.zip | |
Diffstat (limited to 'backup/ad3/backup-cloud')
| -rwxr-xr-x | backup/ad3/backup-cloud | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/backup/ad3/backup-cloud b/backup/ad3/backup-cloud new file mode 100755 index 0000000..82b5a1b --- /dev/null +++ b/backup/ad3/backup-cloud @@ -0,0 +1,30 @@ +set -euo pipefail + +if [ "$(id -u)" -ne 0 ]; then + echo "Run with sudo" + exit 1 +fi + +source /root/.restic-env + +# Backup LUKS header into a location restic will pick up +cryptsetup luksHeaderBackup /dev/nvme0n1p2 \ + --header-backup-file /root/luks-header-backup.tmp +mv /root/luks-header-backup.tmp /root/luks-header-backup + +# Run backup (/ and /boot since /boot is a separate partition) +restic backup / /boot \ + --exclude-file=/home/benj/.mycfg/backup/ad3/restic-exclude.txt \ + --exclude-caches \ + --verbose + +# Retention: 4 weekly, 6 monthly, 1 yearly +restic forget \ + --keep-weekly 4 \ + --keep-monthly 6 \ + --keep-yearly 1 \ + --prune + +echo "" +echo "=== Latest snapshots ===" +restic snapshots --latest 5
\ No newline at end of file |
