aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-05-26 21:17:02 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-05-26 21:17:02 +0200
commitd611f0d71dbfffde16e3d8bea01557237cc2c6ae (patch)
tree687eb2e55edac4e18223bb3efa32202be84598d7
parentedfe644496189da09c12009d8c670e5100515dd9 (diff)
Put backup prune defaults in the default configuration file
-rw-r--r--lib/subcommands/backup.bash16
-rw-r--r--share/defaults5
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