Source a backuprc if we have it to allow for site-local backup storage changes

This commit is contained in:
Salt 2020-05-03 06:08:36 -05:00
parent 6440710a3e
commit 2769a78198

View File

@ -19,7 +19,7 @@ log() {
printf "$(date -Iseconds): $1\n" printf "$(date -Iseconds): $1\n"
} }
# Do the do # Sanity checks
if ! [ -d "$BACKUPSDIR" ]; then if ! [ -d "$BACKUPSDIR" ]; then
log "Unable to find backups directory: $BACKUPSDIR" log "Unable to find backups directory: $BACKUPSDIR"
exit 1 exit 1
@ -28,6 +28,11 @@ if ! [ -d "$MODULESDIR" ]; then
log "Unable to find modules directory: $MODULESDIR" log "Unable to find modules directory: $MODULESDIR"
exit 2 exit 2
fi fi
# Source an RC, if we have it
if [ -r "$MODULESDIR/backuprc" ]; then
source "$MODULESDIR/backuprc"
fi
# Do the do
log "Beginning backups" log "Beginning backups"
for file in "$MODULESDIR"/*; do for file in "$MODULESDIR"/*; do
# Just keep going if we don't have any tasks to do # Just keep going if we don't have any tasks to do