소스 검색

Update sync_host.sh

修复目录容器内不存在导致备份脚本失败的bug
玖亖伍 4 년 전
부모
커밋
acdd2e2f4b
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      sync_host.sh

+ 5 - 2
sync_host.sh

@@ -15,7 +15,10 @@ export HOST_DIR=/mindoc-sync-host
 export DOCKER_DIR=/mindoc
 
 function doSyncCopy() {
-    rclone $SYNC_ACTION --progress --exclude .git* --exclude .git/** "${1}" "${2}"
+    if [ -d "${1}" ] 
+    then
+        rclone $SYNC_ACTION --progress --exclude .git* --exclude .git/** "${1}" "${2}"
+    fi
 }
 
 function doSync() {
@@ -37,4 +40,4 @@ if ! [ -z "${SYNC_LIST}" ]; then
     for item in $SYNC_LIST; do
         doSync "${item}"
     done
-fi
+fi