fix exclusion of job config.xml in folders

This commit is contained in:
Tavin Cole 2025-12-11 12:14:17 +00:00
parent c0d450a2c6
commit b87c238a32
1 changed files with 4 additions and 3 deletions

View File

@ -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"