瀏覽代碼

Retry the mount a few times; the process seems flaky in OS X

Zachary Kotlarek 12 年之前
父節點
當前提交
ce8fb8e095
共有 1 個文件被更改,包括 9 次插入 和 4 次删除
  1. 9 4
      backup/syncPhotos.sh

+ 9 - 4
backup/syncPhotos.sh

@@ -11,10 +11,15 @@ if [ ! -d "${BASE_REMOTE}" ]; then
 fi
 if [ ! -d "${BASE_REMOTE}/${TARGET}" ]; then
 	MOUNTED_REMOTE=1
-	if ! mount_webdav -s https://webdav.opendrive.com "${BASE_REMOTE}"; then
-		echo "Unable to mount remote drive" 1>&2
-		exit 1
-	fi
+	FAIL_COUNT=0
+	while ! mount_webdav -s https://webdav.opendrive.com "${BASE_REMOTE}"; do
+		if [ $FAIL_COUNT -gt 5 ]; then
+			echo "Unable to mount remote drive" 1>&2
+			exit 1
+		fi
+		FAIL_COUNT=$(( $FAIL_COUNT + 1 ))
+		sleep 5
+	done
 fi
 
 # Mount th local drive if needed