From adb1e01c7aa07e2a9b9d3fedc687ff78571bb0fd Mon Sep 17 00:00:00 2001 From: reyesj2 <94730068+reyesj2@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:31:53 -0500 Subject: [PATCH] exclude so_agent_installer dir from config backups --- salt/backup/tools/sbin/so-config-backup.jinja | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/salt/backup/tools/sbin/so-config-backup.jinja b/salt/backup/tools/sbin/so-config-backup.jinja index 23e407653..7f65bbba3 100755 --- a/salt/backup/tools/sbin/so-config-backup.jinja +++ b/salt/backup/tools/sbin/so-config-backup.jinja @@ -11,6 +11,10 @@ TODAY=$(date '+%Y_%m_%d') BACKUPDIR={{ DESTINATION }} BACKUPFILE="$BACKUPDIR/so-config-backup-$TODAY.tar" MAXBACKUPS=7 +EXCLUSIONS=( + "--exclude=/opt/so/saltstack/local/salt/elasticfleet/files/so_agent-installers" +) + # Create backup dir if it does not exist mkdir -p /nsm/backup @@ -23,7 +27,7 @@ if [ ! -f $BACKUPFILE ]; then # Loop through all paths defined in global.sls, and append them to backup file {%- for LOCATION in BACKUPLOCATIONS %} - tar -rf $BACKUPFILE {{ LOCATION }} + tar -rf $BACKUPFILE "${EXCLUSIONS[@]}" {{ LOCATION }} {%- endfor %} fi