From a0b4759412a311ef512644acd5fd12b0935c3c56 Mon Sep 17 00:00:00 2001 From: Teddysun Date: Mon, 13 Jul 2020 15:14:56 +0900 Subject: [PATCH] Update comments Fixed "too many arguments" error --- backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup.sh b/backup.sh index be58f3c..ddaeeb0 100644 --- a/backup.sh +++ b/backup.sh @@ -190,10 +190,10 @@ EOF } start_backup() { - [ "${BACKUP[*]}" == "" ] && echo "Error: You must to modify the [$(basename $0)] config before run it!" && exit 1 + [ "${#BACKUP[@]}" -eq 0 ] && echo "Error: You must to modify the [$(basename $0)] config before run it!" && exit 1 log "Tar backup file start" - tar -zcPf ${TARFILE} ${BACKUP[*]} + tar -zcPf ${TARFILE} ${BACKUP[@]} if [ $? -gt 1 ]; then log "Tar backup file failed" exit 1