Add additional items to base role
Backups, GRUB configuration, and IPMI configuration.
This commit is contained in:
15
roles/base/templates/etc/cron.daily/pvc-backup.j2
Executable file
15
roles/base/templates/etc/cron.daily/pvc-backup.j2
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Backup the PVC Zookeeper database
|
||||
# {{ ansible_managed }}
|
||||
|
||||
set -o errexit
|
||||
|
||||
BACKUP_DIR="/srv/backups/"
|
||||
BACKUP_FILENAME_BASE="pvc-zookeeper-backup"
|
||||
DATE="$( date +%Y%m%d )"
|
||||
BACKUP_FILENAME="${BACKUP_DIR}/${BACKUP_FILENAME_BASE}.${DATE}.json"
|
||||
|
||||
pvc -c local task backup > ${BACKUP_FILENAME}
|
||||
xz ${BACKUP_FILENAME}
|
||||
find ${BACKUP_DIR} -type f -name "${BACKUP_FILENAME_BASE}*" -mtime +7 -exec rm {} \;
|
Reference in New Issue
Block a user