avoid backing-up empty volumes to avoid typos

pull/17/head
Jarek Lipski 2019-02-10 11:26:09 +01:00
rodzic 222b9b170e
commit 3b77acf1c1
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -6,6 +6,11 @@ usage() {
}
backup() {
if [ -z "$(ls -A /volume)" ]; then
>&2 echo "Volume is empty or missing, check if you specified a correct name"
exit 1
fi
if ! [ "$ARCHIVE" == "-" ]; then
mkdir -p `dirname /backup/$ARCHIVE`
fi