Skip to content

Commit acdd2e2

Browse files
authored
Update sync_host.sh
修复目录容器内不存在导致备份脚本失败的bug
1 parent 097af00 commit acdd2e2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sync_host.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export HOST_DIR=/mindoc-sync-host
1515
export DOCKER_DIR=/mindoc
1616

1717
function doSyncCopy() {
18-
rclone $SYNC_ACTION --progress --exclude .git* --exclude .git/** "${1}" "${2}"
18+
if [ -d "${1}" ]
19+
then
20+
rclone $SYNC_ACTION --progress --exclude .git* --exclude .git/** "${1}" "${2}"
21+
fi
1922
}
2023

2124
function doSync() {
@@ -37,4 +40,4 @@ if ! [ -z "${SYNC_LIST}" ]; then
3740
for item in $SYNC_LIST; do
3841
doSync "${item}"
3942
done
40-
fi
43+
fi

0 commit comments

Comments
 (0)