From d611f0d71dbfffde16e3d8bea01557237cc2c6ae Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Thu, 26 May 2022 21:17:02 +0200 Subject: Put backup prune defaults in the default configuration file --- lib/subcommands/backup.bash | 16 ++++++++-------- share/defaults | 5 ++++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/subcommands/backup.bash b/lib/subcommands/backup.bash index 2765172..3a7b426 100644 --- a/lib/subcommands/backup.bash +++ b/lib/subcommands/backup.bash @@ -71,10 +71,10 @@ backup_filesystem() { info "$BASHTARD_NAME/backup/$index" "Pruning filesystem backups in $repo" cmd_prune=( "$borg" "prune" - "--keep-daily" "$(config "bashtard.backup.keep.daily" 7)" - "--keep-weekly" "$(config "bashtard.backup.keep.weekly" 4)" - "--keep-monthly" "$(config "bashtard.backup.keep.monthly" 6)" - "--keep-yearly" "$(config "bashtard.backup.keep.yearly" 1)" + "--keep-daily" "$(config "bashtard.backup.keep.daily")" + "--keep-weekly" "$(config "bashtard.backup.keep.weekly")" + "--keep-monthly" "$(config "bashtard.backup.keep.monthly")" + "--keep-yearly" "$(config "bashtard.backup.keep.yearly")" "--prefix" "{fqdn}-" "--remote-path" "$remote" "$repo/hostfs" @@ -137,10 +137,10 @@ backup_database_postgresql() { # Prune old backups info "$BASHTARD_NAME/backup/$index" "Pruning PostgreSQL backups of $database in $repo" $borg prune \ - --keep-daily "$(config "bashtard.backup.keep.daily" 7)" \ - --keep-weekly "$(config "bashtard.backup.keep.weekly" 4)" \ - --keep-monthly "$(config "bashtard.backup.keep.monthly" 6)" \ - --keep-yearly "$(config "bashtard.backup.keep.yearly" 1)" \ + --keep-daily "$(config "bashtard.backup.keep.daily")" \ + --keep-weekly "$(config "bashtard.backup.keep.weekly")" \ + --keep-monthly "$(config "bashtard.backup.keep.monthly")" \ + --keep-yearly "$(config "bashtard.backup.keep.yearly")" \ --prefix "$database-" \ --remote-path "$remote" \ "$repo/postgresql-$database" diff --git a/share/defaults b/share/defaults index 409c804..0db1b0e 100644 --- a/share/defaults +++ b/share/defaults @@ -2,7 +2,10 @@ # # SPDX-License-Identifier: AGPL-3.0-or-later -app.ssh=ssh +bashtard.backup.keep.daily=7 +bashtard.backup.keep.monthly=6 +bashtard.backup.keep.weekly=4 +bashtard.backup.keep.yearly=2 fs.bindir=/usr/bin fs.etcdir=/etc -- cgit v1.1