Zachary Kotlarek 12 лет назад
Родитель
Сommit
ede72b5b46
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      backup/sync.sh

+ 2 - 2
backup/sync.sh

@@ -66,7 +66,7 @@ fi
 
 
 # Create the named subdirectory if it does not exist on the remote drive
 # Create the named subdirectory if it does not exist on the remote drive
 if [ ! -d "${BASE_REMOTE}/${SUB_DIR}" ]; then
 if [ ! -d "${BASE_REMOTE}/${SUB_DIR}" ]; then
-	mkdir -p "${BASE_REMOTE}/${SUB_DIR}"
+	timeout "${TIMEOUT}" mkdir -p "${BASE_REMOTE}/${SUB_DIR}"
 fi
 fi
 
 
 # Grab and sort the local file list
 # Grab and sort the local file list
@@ -79,7 +79,7 @@ cat "${TMP_LOCAL2}" | sort > "${TMP_LOCAL}"
 
 
 # Grab and sort the remote file list
 # Grab and sort the remote file list
 TMP_REMOTE="`mktemp -t sync.remote.XXXXXXXX`"
 TMP_REMOTE="`mktemp -t sync.remote.XXXXXXXX`"
-(cd "${BASE_REMOTE}" && find "${SUB_DIR}" | sort > "${TMP_REMOTE}")
+(timeout "${TIMEOUT}" cd "${BASE_REMOTE}" && timeout "$(( $TIMEOUT * 10 ))" find "${SUB_DIR}" | sort > "${TMP_REMOTE}")
 
 
 # Diff to find the first mis-matched file, then drop out temp files
 # Diff to find the first mis-matched file, then drop out temp files
 TMP_DIFF="`mktemp -t sync.diff.XXXXXXXX`"
 TMP_DIFF="`mktemp -t sync.diff.XXXXXXXX`"