mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-04-10 14:51:56 +02:00
- pg_dumpall piped through gzip, stored in /nsm/backup/ - Runs daily at 00:05 (4 minutes after config backup) - 7-day retention matching existing config backup policy - Skips gracefully if container isn't running
55 lines
1.2 KiB
Plaintext
55 lines
1.2 KiB
Plaintext
{% from 'backup/map.jinja' import BACKUP_MERGED %}
|
|
|
|
# Lock permissions on the backup directory
|
|
backupdir:
|
|
file.directory:
|
|
- name: /nsm/backup
|
|
- user: 0
|
|
- group: 0
|
|
- makedirs: True
|
|
- mode: 700
|
|
|
|
config_backup_script:
|
|
file.managed:
|
|
- name: /usr/sbin/so-config-backup
|
|
- user: root
|
|
- group: root
|
|
- mode: 755
|
|
- template: jinja
|
|
- source: salt://backup/tools/sbin/so-config-backup.jinja
|
|
- defaults:
|
|
BACKUPLOCATIONS: {{ BACKUP_MERGED.locations }}
|
|
DESTINATION: {{ BACKUP_MERGED.destination }}
|
|
|
|
# Add config backup
|
|
so_config_backup:
|
|
cron.present:
|
|
- name: /usr/sbin/so-config-backup > /dev/null 2>&1
|
|
- identifier: so_config_backup
|
|
- user: root
|
|
- minute: '1'
|
|
- hour: '0'
|
|
- daymonth: '*'
|
|
- month: '*'
|
|
- dayweek: '*'
|
|
|
|
postgres_backup_script:
|
|
file.managed:
|
|
- name: /usr/sbin/so-postgres-backup
|
|
- user: root
|
|
- group: root
|
|
- mode: 755
|
|
- source: salt://backup/tools/sbin/so-postgres-backup
|
|
|
|
# Add postgres database backup
|
|
so_postgres_backup:
|
|
cron.present:
|
|
- name: /usr/sbin/so-postgres-backup > /dev/null 2>&1
|
|
- identifier: so_postgres_backup
|
|
- user: root
|
|
- minute: '5'
|
|
- hour: '0'
|
|
- daymonth: '*'
|
|
- month: '*'
|
|
- dayweek: '*'
|