Check for backups dir AFTER we might've changed it

This commit is contained in:
Salt 2020-05-03 06:09:10 -05:00
parent 2769a78198
commit ed04787e9b

View File

@ -20,10 +20,6 @@ log() {
}
# Sanity checks
if ! [ -d "$BACKUPSDIR" ]; then
log "Unable to find backups directory: $BACKUPSDIR"
exit 1
fi
if ! [ -d "$MODULESDIR" ]; then
log "Unable to find modules directory: $MODULESDIR"
exit 2
@ -32,6 +28,11 @@ fi
if [ -r "$MODULESDIR/backuprc" ]; then
source "$MODULESDIR/backuprc"
fi
# More sanity checks
if ! [ -d "$BACKUPSDIR" ]; then
log "Unable to find backups directory: $BACKUPSDIR"
exit 1
fi
# Do the do
log "Beginning backups"
for file in "$MODULESDIR"/*; do