Explorar o código

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

Zachary Kotlarek %!s(int64=12) %!d(string=hai) anos
pai
achega
ce8fb8e095
Modificáronse 1 ficheiros con 9 adicións e 4 borrados
  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