From d039bb6ed97964aef84e14e880aa7a52adab9221 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Wed, 29 Sep 2021 20:31:40 -0700 Subject: [PATCH] adding clean command --- backup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backup.sh b/backup.sh index 38b3f19..9ef9345 100755 --- a/backup.sh +++ b/backup.sh @@ -22,6 +22,7 @@ print_help () { Supported Commands: backup - initiate a backup of the home folder to the destination check - check repository for consistency + clean - clean (prune) extra files from the repository find - find a file by a string in the repository (requires input) ex: backup.sh find s3 critical_file.doc help - print this help @@ -209,6 +210,13 @@ else --verbose \ unlock | print_and_log ;; + "clean") + echo "Cleaning repository at $DESTINATION" | print_and_log + /usr/bin/restic \ + -r "$BACKUP_REPOSITORY" \ + -p "$BACKUP_PASSWORD" \ + --verbose \ + prune | print_and_log *) echo "Action: $ACTION not recognized." print_help