浏览代码

Update comments
Fixed "too many arguments" error

Teddysun 5 年之前
父节点
当前提交
a0b4759412
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      backup.sh

+ 2 - 2
backup.sh

@@ -190,10 +190,10 @@ EOF
 }
 }
 
 
 start_backup() {
 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"
     log "Tar backup file start"
-    tar -zcPf ${TARFILE} ${BACKUP[*]}
+    tar -zcPf ${TARFILE} ${BACKUP[@]}
     if [ $? -gt 1 ]; then
     if [ $? -gt 1 ]; then
         log "Tar backup file failed"
         log "Tar backup file failed"
         exit 1
         exit 1