From b37f882d7dcaade70a767391839f1a60efe5fb29 Mon Sep 17 00:00:00 2001 From: Jacob Babor Date: Mon, 10 Jun 2024 22:54:03 -0500 Subject: [PATCH] Improve grep in ostree config-diff to not choke on spaces in filenames --- roles/backup/templates/s3backup.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/roles/backup/templates/s3backup.sh b/roles/backup/templates/s3backup.sh index 9b373c2..7f96634 100644 --- a/roles/backup/templates/s3backup.sh +++ b/roles/backup/templates/s3backup.sh @@ -39,8 +39,7 @@ DIRS+=("{{ item }}") if command -v ostree > /dev/null 2>&1; then for file in $( ostree admin config-diff 2>/dev/null | \ - grep -e '^[A|M]' | \ - awk '{print $2}' + grep -oP '^[A|M]\s*\K.*' ); do DIRS+=("/etc/$file") done