backupskripte

This commit is contained in:
Marc Hoppe
2017-01-07 21:18:53 +01:00
parent 61d351c7e0
commit 3731b1551b
5 changed files with 31 additions and 6 deletions

View File

@@ -1,10 +1,11 @@
#!/bin/sh
REPOSITORY=pi@vdrpi:/media/hdext/borg
PREFIX=nasgps
BAKDIRS="/dat/docu/gps"
borg create -v --stats --progress --compression zlib --one-file-system \
$REPOSITORY::'nasgps-{now:%Y-%m-%d}' \
/dat/docu/gps \
$REPOSITORY::$PREFIX-'{now:%Y-%m-%d}' \
$BAKDIRS \
--exclude '*/tmp/*' \
--exclude '*.iso' \
--exclude '*.exe' \
@@ -20,5 +21,5 @@ borg create -v --stats --progress --compression zlib --one-file-system \
# 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 $REPOSITORY --prefix 'nasgps-' \
borg prune -v $REPOSITORY --prefix $PREFIX- \
--keep-daily=7 --keep-weekly=4 --keep-monthly=20