From: Michael Tremer Date: Tue, 16 Apr 2019 12:22:10 +0000 (+0100) Subject: backup: Allow passing name of tarball for creation/restore X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=175f5c060ea8b967bc3020b376385d5b71116e92;p=people%2Fms%2Fipfire-2.x.git backup: Allow passing name of tarball for creation/restore Signed-off-by: Michael Tremer --- 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