mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-13 12:32:59 +02:00
backup: Allow passing name of tarball for creation/restore
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user