From 175f5c060ea8b967bc3020b376385d5b71116e92 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 16 Apr 2019 13:22:10 +0100 Subject: [PATCH] backup: Allow passing name of tarball for creation/restore Signed-off-by: Michael Tremer --- config/backup/backup.pl | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/config/backup/backup.pl b/config/backup/backup.pl index 5737740e56..6ac4e49673 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -176,19 +176,34 @@ main() { local command="${1}" shift - # Desired backup filename - local filename="/var/ipfire/backup/${NOW}.ipf" - case "${command}" in include) + local filename="${1}" + + if [ -z "${filename}" ]; then + filename="/var/ipfire/backup/${NOW}.ipf" + fi + make_backup "${filename}" $(find_logfiles) ;; exclude) + local filename="${1}" + + if [ -z "${filename}" ]; then + filename="/var/ipfire/backup/${NOW}.ipf" + fi + make_backup "${filename}" ;; restore) + local filename="${1}" + + if [ -z "${filename}" ]; then + filename="/tmp/restore.ipf" + fi + restore_backup "/tmp/restore.ipf" ;; @@ -201,6 +216,9 @@ main() { ;; iso) + # Desired backup filename + local filename="/var/ipfire/backup/${NOW}.ipf" + if make_backup "${filename}"; then /usr/local/bin/backupiso "${NOW}" & fi -- 2.39.5