backupscripts for borg

This commit is contained in:
Marc Hoppe
2017-01-01 00:45:27 +01:00
parent c7ac9961fe
commit 61d351c7e0
4 changed files with 106 additions and 0 deletions

25
bakupme.sh Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
REPOSITORY=pi@vdrpi:/media/hdext/borg
borg create -v --stats --progress --compression zlib --one-file-system \
$REPOSITORY::'{hostname}-{now:%Y-%m-%d}' \
/ \
--exclude '/var/cache/apt/archives/*.deb' \
--exclude '/var/cache/man' \
--exclude '*/tmp/*' \
--exclude '/var/tmp' \
--exclude '*/.cache/*' \
--exclude '*/cache/*' \
--exclude '*/.ccache/*' \
--exclude '*/mlocate.db*' \
--exclude '/run'
# 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 $REPOSITORY --prefix '{hostname}-' \
--keep-daily=7 --keep-weekly=4 --keep-monthly=20