This patch is changing the behaviour of the backup script so that it creates one tarball and compresses it in one go.
This will save storing the original tarball on disk before compressing it which on my test system requires significant disk space.
This patch also solves a bug where the backup file included with the ISO image could not be extracted because it was not gzip-compressed when it was expected to be.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- config/backup/backup.pl | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/config/backup/backup.pl b/config/backup/backup.pl index 0b47af2d6..bed5952de 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -58,20 +58,13 @@ make_backup() { done
# Backup using global exclude/include definitions - tar cvf "${filename}" \ + tar cvfz "${filename}" \ --exclude-from="/var/ipfire/backup/exclude" \ - $(process_includes "/var/ipfire/backup/include") \ - "$@" - - # Backup using user exclude/include definitions and append to global backup - tar rvf "${filename}" \ --exclude-from="/var/ipfire/backup/exclude.user" \ + $(process_includes "/var/ipfire/backup/include") \ $(process_includes "/var/ipfire/backup/include.user") \ "$@"
- # gzip the combined global/user backup and use .ipf suffix - gzip --suffix .ipf "${filename}" - return 0 }
@@ -215,7 +208,7 @@ main() { local filename="${1}"
if [ -z "${filename}" ]; then - filename="/var/ipfire/backup/${NOW}" + filename="/var/ipfire/backup/${NOW}.ipf" fi
make_backup "${filename}" $(find_logfiles) @@ -225,7 +218,7 @@ main() { local filename="${1}"
if [ -z "${filename}" ]; then - filename="/var/ipfire/backup/${NOW}" + filename="/var/ipfire/backup/${NOW}.ipf" fi
make_backup "${filename}"