mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #14890 from Security-Onion-Solutions/reyesj2-backup-script
exclude so_agent_installer dir from config backups
This commit is contained in:
@@ -11,6 +11,10 @@ TODAY=$(date '+%Y_%m_%d')
|
|||||||
BACKUPDIR={{ DESTINATION }}
|
BACKUPDIR={{ DESTINATION }}
|
||||||
BACKUPFILE="$BACKUPDIR/so-config-backup-$TODAY.tar"
|
BACKUPFILE="$BACKUPDIR/so-config-backup-$TODAY.tar"
|
||||||
MAXBACKUPS=7
|
MAXBACKUPS=7
|
||||||
|
EXCLUSIONS=(
|
||||||
|
"--exclude=/opt/so/saltstack/local/salt/elasticfleet/files/so_agent-installers"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Create backup dir if it does not exist
|
# Create backup dir if it does not exist
|
||||||
mkdir -p /nsm/backup
|
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
|
# Loop through all paths defined in global.sls, and append them to backup file
|
||||||
{%- for LOCATION in BACKUPLOCATIONS %}
|
{%- for LOCATION in BACKUPLOCATIONS %}
|
||||||
tar -rf $BACKUPFILE {{ LOCATION }}
|
tar -rf $BACKUPFILE "${EXCLUSIONS[@]}" {{ LOCATION }}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user