From 45a2012e71ea41d6545c32c08863b66c6e6ce281 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 3 May 2024 12:56:42 +0200 Subject: scripts: save/restore: move -T - after options for new versions of tar New versions of GNU tar ignore --no-recursion and --exclude-from when placed after -T, resulting in files being saved instead of being ignored etc, so let's swap them. --- scripts/restore-etc | 2 +- scripts/save-etc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/restore-etc b/scripts/restore-etc index 52e0de5..8bda098 100755 --- a/scripts/restore-etc +++ b/scripts/restore-etc @@ -121,7 +121,7 @@ list_changes() { if [ -r "$ROOTDIR$FILE" ]; then flx check --ignore-dot --ignore-link --ignore-date file:"$ROOTDIR$FILE" fs:"$ROOTDIR/etc"=etc \ | awk '/^[+>]/ { print $9 }' \ - | tar -C "$ROOTDIR/" -T - --one-file-system --numeric-owner --no-recursion --exclude-from $EXCLUDE -cvf /dev/null 2>/dev/null + | tar -C "$ROOTDIR/" --one-file-system --numeric-owner --no-recursion --exclude-from $EXCLUDE -T - -cvf /dev/null 2>/dev/null else tar -C "$ROOTDIR/" --one-file-system --numeric-owner --exclude-from $EXCLUDE -cvf /dev/null etc 2>/dev/null fi diff --git a/scripts/save-etc b/scripts/save-etc index ff445f2..7f8837d 100755 --- a/scripts/save-etc +++ b/scripts/save-etc @@ -114,7 +114,7 @@ write_journal() archive_etc() { flx check --ignore-dot --ignore-link --ignore-date $REFERENCE=etc /etc=etc \ | awk '/^[+>]/ { print $9 }' \ - | tar -C / -T - --one-file-system --numeric-owner --no-recursion --exclude-from $EXCLUDE -cf - \ + | tar -C / --no-recursion --exclude-from $EXCLUDE --one-file-system --numeric-owner -T - -cf - \ | gzip -c9 } @@ -152,7 +152,7 @@ list_changes() { if [ -r "$FILE" ]; then flx check --ignore-dot --ignore-link --ignore-date file:$FILE fs:/etc \ | awk '/^[+>]/ { print $9 }' \ - | tar -C / -T - --one-file-system --numeric-owner --no-recursion --exclude-from $EXCLUDE -cvf /dev/null 2>/dev/null + | tar -C / --no-recursion --exclude-from $EXCLUDE --one-file-system --numeric-owner -T - -cvf /dev/null 2>/dev/null else tar -C / --one-file-system --numeric-owner --exclude-from $EXCLUDE -cvf /dev/null etc 2>/dev/null fi -- 2.35.3