From 197b4b7064a0845883edb14ad3939e4d663e614b Mon Sep 17 00:00:00 2001 From: Todd E Johnson Date: Thu, 25 Jul 2019 22:51:07 -0500 Subject: [PATCH 1/3] Forget now has --prune which might be more efficent. --- usr/local/sbin/restic_backup.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/usr/local/sbin/restic_backup.sh b/usr/local/sbin/restic_backup.sh index 5f849be..05ffb30 100644 --- a/usr/local/sbin/restic_backup.sh +++ b/usr/local/sbin/restic_backup.sh @@ -71,6 +71,7 @@ wait $! restic forget \ --verbose \ --tag $BACKUP_TAG \ + --prune --group-by "paths,tags" \ --keep-daily $RETENTION_DAYS \ --keep-weekly $RETENTION_WEEKS \ @@ -78,13 +79,6 @@ restic forget \ --keep-yearly $RETENTION_YEARS & wait $! -# Remove old data not linked anymore. -# See restic-prune(1) or http://restic.readthedocs.io/en/latest/060_forget.html -restic prune \ - --option b2.connections=$B2_CONNECTIONS \ - --verbose & -wait $! - # Check repository for errors. # NOTE this takes much time (and data transfer from remote repo?), do this in a separate systemd.timer which is run less often. #restic check & From be5c07bd0f9ebd76d5ac1fd0d830c12d86fb94e4 Mon Sep 17 00:00:00 2001 From: Todd E Johnson Date: Wed, 31 Jul 2019 22:56:24 -0500 Subject: [PATCH 2/3] Update comment describing restic-forget to note prune --- usr/local/sbin/restic_backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/sbin/restic_backup.sh b/usr/local/sbin/restic_backup.sh index 05ffb30..8ffa0b1 100644 --- a/usr/local/sbin/restic_backup.sh +++ b/usr/local/sbin/restic_backup.sh @@ -65,7 +65,7 @@ restic backup \ $BACKUP_PATHS & wait $! -# Dereference old backups. +# Dereference and delete/prune old backups. # See restic-forget(1) or http://restic.readthedocs.io/en/latest/060_forget.html # --group-by only the tag and path, and not by hostname. This is because I create a B2 Bucket per host, and if this hostname accidentially change some time, there would now be multiple backup sets. restic forget \ From 429ee40220131bf6ee9fab68b65be2d265a8c496 Mon Sep 17 00:00:00 2001 From: Todd E Johnson Date: Wed, 31 Jul 2019 22:59:03 -0500 Subject: [PATCH 3/3] Add b2 connection limit to forget now that it prunes. --- usr/local/sbin/restic_backup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr/local/sbin/restic_backup.sh b/usr/local/sbin/restic_backup.sh index 8ffa0b1..885427e 100644 --- a/usr/local/sbin/restic_backup.sh +++ b/usr/local/sbin/restic_backup.sh @@ -71,7 +71,8 @@ wait $! restic forget \ --verbose \ --tag $BACKUP_TAG \ - --prune + --option b2.connections=$B2_CONNECTIONS \ + --prune \ --group-by "paths,tags" \ --keep-daily $RETENTION_DAYS \ --keep-weekly $RETENTION_WEEKS \