From b87c238a321cb2019afa316402d3183cc941716d Mon Sep 17 00:00:00 2001 From: Tavin Cole Date: Thu, 11 Dec 2025 12:14:17 +0000 Subject: [PATCH] fix exclusion of job config.xml in folders --- backup/pvc/bin/backup.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backup/pvc/bin/backup.sh b/backup/pvc/bin/backup.sh index 40c9f8dd..622e458f 100755 --- a/backup/pvc/bin/backup.sh +++ b/backup/pvc/bin/backup.sh @@ -41,11 +41,12 @@ trap '_trap' SIGQUIT SIGINT SIGTERM # config.xml in child directories is state that should. For example- # branches/myorg/branches/myrepo/branches/master/config.xml should be retained while # branches/myorg/config.xml should not +ret=0 tar --zstd -C "${JENKINS_HOME}" -cf "${BACKUP_TMP_DIR}/${BACKUP_NUMBER}.tar.zstd" \ - --exclude jobs/*/workspace* \ - --no-wildcards-match-slash --anchored \ + --exclude 'jobs/*/workspace*' \ + --no-wildcards-match-slash \ --ignore-failed-read \ - --exclude jobs/*/config.xml -c jobs || ret=$? + --exclude 'jobs/*/config.xml' -c jobs || ret=$? if [[ "$ret" -eq 0 ]]; then _log "INFO" "[backup] backup ${BACKUP_NUMBER} was completed without warnings"