From 18d570509ef45a518724797112b45fbdaa775991 Mon Sep 17 00:00:00 2001 From: Marc Hoppe Date: Fri, 18 Oct 2019 21:39:46 +0200 Subject: [PATCH] backuproot2nas hinzu --- backuproot2nas.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 backuproot2nas.sh diff --git a/backuproot2nas.sh b/backuproot2nas.sh new file mode 100644 index 0000000..3672272 --- /dev/null +++ b/backuproot2nas.sh @@ -0,0 +1,26 @@ +#!/bin/sh +REPOSITORY=marc@nas:/dat/bak/borg + +if [ "$1" != "--prune" ]; then +borg create -v --stats --progress --compression zlib --one-file-system \ + $REPOSITORY::'{hostname}-{now:%Y-%m-%d}' \ + / \ + --exclude '*/tmp/*' \ + --exclude '*/tmpfile/*' \ + --exclude '/var/tmp/*' \ + --exclude '/var/crash/*' \ + --exclude '*/.cache/*' \ + --exclude '*/cache/*' \ + --exclude '*/.ccache/*' \ + --exclude '*/mlocate.db*' \ + --exclude '/run' +fi + + + +# Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly +# archives of THIS machine. The '{hostname}-' prefix is very important to +# limit prune's operation to this machine's archives and not apply to +# other machine's archives also. +borg prune -v --stats $REPOSITORY --prefix '{hostname}-' \ + --keep-daily=7 --keep-weekly=4 --keep-monthly=20