diff options
author | Carlo Landmeter <clandmeter@alpinelinux.org> | 2018-01-31 00:07:00 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@alpinelinux.org> | 2018-01-31 00:07:00 +0000 |
commit | e611c886b159b67e41278373ccd348b6c46573c9 (patch) | |
tree | 74734e1ffc496e63191cc4c7ea3d111fa0c0ae3d /alpine-backup | |
parent | dbba658aa7bbefec00171c47187ac394c2d4a887 (diff) | |
download | alpine-backup-e611c886b159b67e41278373ccd348b6c46573c9.tar.bz2 alpine-backup-e611c886b159b67e41278373ccd348b6c46573c9.tar.xz |
make sure backup location and cache are set
Diffstat (limited to 'alpine-backup')
-rwxr-xr-x | alpine-backup | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/alpine-backup b/alpine-backup index cf05943..446218b 100755 --- a/alpine-backup +++ b/alpine-backup @@ -9,7 +9,12 @@ else exit 1 fi -mkdir -p "$BACKUP_LOCATION" "$BACKUP_CACHE" +if [ -n "$BACKUP_LOCATION" ] && [ -n " $BACKUP_CACHE" ]; then + mkdir -p "$BACKUP_LOCATION" "$BACKUP_CACHE" +else + echo "Error: BACKUP_LOCATION and/or BACKUP_CACHE are not set!" + exit 1 +fi # set the suffix of backup files when ecryptions is enabled [ -n "$ENCRYPTION" ] && export SUFFIX=".$ENCRYPTION" |