Zachary Kotlarek 12 лет назад
Родитель
Сommit
746e435e5a
2 измененных файлов с 11 добавлено и 10 удалено
  1. 10 9
      sync/sync.sh
  2. 1 1
      sync/syncUnwatched.sh

+ 10 - 9
sync/sync.sh

@@ -102,14 +102,15 @@ for infile in $FILES; do
 
 
 	# If the singular output error is "already exists" assume the error is related to filename encoding
 	# If the singular output error is "already exists" assume the error is related to filename encoding
 	# Suppress the error and touch the output file to prevent it from being deleted
 	# Suppress the error and touch the output file to prevent it from being deleted
-	if [ -n "${ERR}" ] && \
-		[ `echo "${ERR}" | wc -l` -eq 1 ] && \
-		echo "${ERR}" | grep -q 'encode.pl: Output file exists: '; then
-			OUTFILE="`echo "${ERR}" | \
-				sed 's%encode.pl: Output file exists: %%' | \
-				sed 's%. Skipping...%%'`"
-			touch "${OUTFILE}"
-	else
-		echo "${ERR}" 1>&2
+	if [ -n "${ERR}" ]; then
+		if [ `echo "${ERR}" | wc -l` -eq 1 ] && \
+			echo "${ERR}" | grep -q 'encode.pl: Output file exists: '; then
+				OUTFILE="`echo "${ERR}" | \
+					sed 's%encode.pl: Output file exists: %%' | \
+					sed 's%. Skipping...%%'`"
+				touch "${OUTFILE}"
+		else
+			echo "${ERR}" 1>&2
+		fi
 	fi
 	fi
 done
 done

+ 1 - 1
sync/syncUnwatched.sh

@@ -93,7 +93,7 @@ IFS=$'\n'
 MIN_AGE="`date -v -1H +%s`"
 MIN_AGE="`date -v -1H +%s`"
 for i in $OLD_FILES; do
 for i in $OLD_FILES; do
 	# Skip files under 1H old to avoid churn and provide a no-delete signal for other conditions (e.g. filename encoding)
 	# Skip files under 1H old to avoid churn and provide a no-delete signal for other conditions (e.g. filename encoding)
-	STAT="`stat -f '%m' "${BASE_DIR}/${i}" >/dev/null 2>&1`"
+	STAT="`stat -f '%m' "${BASE_DIR}/${i}" 2>/dev/null`"
 	if [ -z "${STAT}" ]; then
 	if [ -z "${STAT}" ]; then
 		STAT=1
 		STAT=1
 	fi
 	fi