This repository has been archived by the owner on Apr 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from weslambert/master
add cron jobs for backing up server/sensor config daily
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# /etc/cron.d/sensor-backup-config | ||
# | ||
# crontab entry to backup sensor config; purge backups older than 10 days | ||
DAYSTOKEEP=10 | ||
SHELL=/bin/bash | ||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
0 1 * * * root if [ -d /etc/nsm/backup ]; then :; else mkdir /etc/nsm/backup; fi; for i in $(cat /etc/nsm/sensortab | grep -v '#' | awk '{print $1}'); do /usr/sbin/nsm_sensor_backup-config --force-yes --sensor-name=$i --backup-file=/etc/nsm/backup/$i-sensor-backup-`date +\%Y-\%m-\%d`.tar.gz >> /var/log/nsm/$i-backup-config.log 2>&1; done; /usr/bin/find /etc/nsm/backup/*sensor-backup*.tar.gz -mtime +$DAYSTOKEEP -exec rm -f {} \; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# /etc/cron.d/server-backup-config | ||
# | ||
# crontab entry to backup server config; purge backups older than 10 days | ||
DAYSTOKEEP=10 | ||
SHELL=/bin/sh | ||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
0 1 * * * root if [ -d /etc/nsm/backup ]; then :; else mkdir /etc/nsm/backup; fi; /usr/sbin/nsm_server_backup-config --force-yes --server-name=securityonion --backup-file=/etc/nsm/backup/securityonion-server-backup-`date +\%Y-\%m-\%d`.tar.gz >> /var/log/nsm/server-backup-config.log 2>&1; /usr/bin/find /etc/nsm/backup/*server-backup*.tar.gz -mtime +$DAYSTOKEEP -exec rm -f {} \; | ||
|