Joshua M. Boniface 45322e0f9e Add additional items to base role
Backups, GRUB configuration, and IPMI configuration.
2021-05-12 13:53:15 -04:00

16 lines
409 B
Django/Jinja
Executable File

#!/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 {} \;