Quieting the process, adding exclude for ~/backups, adding check functions

This commit is contained in:
Andrew Davidson 2020-04-03 10:01:16 -04:00
parent 82588528a5
commit 209f1789ed
Signed by: amd
GPG key ID: 17AF8F2A49CF25C6

View file

@ -64,10 +64,9 @@ case $DESTINATION in
"royal") "royal")
case $ACTION in case $ACTION in
"backup") "backup")
echo "$(date) starting backup to $DESTINATION"
if on_ac_power; then if on_ac_power; then
borg create --progress -s -v \ borg create \
--exclude $HOME/backups \
--exclude $HOME/tmp \ --exclude $HOME/tmp \
--exclude $HOME/Downloads \ --exclude $HOME/Downloads \
--exclude $HOME/Desktop \ --exclude $HOME/Desktop \
@ -78,8 +77,9 @@ case $DESTINATION in
else else
echo "Not plugged in, canceling backup." echo "Not plugged in, canceling backup."
fi fi
;;
echo "$(date) finished backup to $DESTINATION" "check")
borg check backup:/bkup/$(hostname)
;; ;;
"list") "list")
borg list backup:/bkup/$(hostname) borg list backup:/bkup/$(hostname)
@ -114,11 +114,10 @@ case $DESTINATION in
"wasabi") "wasabi")
case $ACTION in case $ACTION in
"backup") "backup")
echo "$(date) starting backup to $DESTINATION"
if on_ac_power; then if on_ac_power; then
restic backup \ restic backup \
--verbose \ --quiet \
--exclude $HOME/backups \
--exclude $HOME/tmp \ --exclude $HOME/tmp \
--exclude $HOME/Desktop \ --exclude $HOME/Desktop \
--exclude $HOME/Downloads \ --exclude $HOME/Downloads \
@ -129,8 +128,9 @@ case $DESTINATION in
else else
echo "Not plugged in, canceling backup." echo "Not plugged in, canceling backup."
fi fi
;;
echo "$(date) finished backup to $DESTINATION" "check")
restic check
;; ;;
"list") "list")
restic snapshots restic snapshots
@ -139,7 +139,6 @@ case $DESTINATION in
echo """ echo """
Pruning $DESTINATION backups... Pruning $DESTINATION backups...
Keeping: Keeping:
- 4 hourly backups
- 90 daily backups - 90 daily backups
- 12 monthly backups - 12 monthly backups
- 5 yearly backups - 5 yearly backups