Hello Adolf,
Thank you for reviewing my patch :)
On 2 Dec 2021, at 13:42, Adolf Belka adolf.belka@ipfire.org wrote:
Hi Michael,
I split the tar into two stages in May of this year as a fix for Bug #12626.
If the tar/gzip is done in one go then any files in the include.user file that match a pattern in the global exclude will always be ignored as the --exclude-from has precedence over any file lists at the end of the command.
I should have reached out because it wasn’t quite clear to me why this was split into two operations.
I would have considered this the expected behaviour, because what is excluded is excluded. Clearly you expected something else to happen which I would also consider a valid expectation.
If this patch is implemented then I would edit the wiki to specify that user files, wanting to be backed up by adding to the include.user file, should not be in any of the directories listed in the global exclude file and must not have a .tmp extension.
Is there any use-case where this would become a big problem? Is there anything the user would include that has previously been globally excluded?
-Michael
Regards,
Adolf.
On 02/12/2021 13:37, Michael Tremer wrote:
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.user") \ "$@"$(process_includes "/var/ipfire/backup/include") \
- # 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}"
-- Sent from my laptop