From c5bd7b890bc9d66bd6f33f762348ae2747b52bf5 Mon Sep 17 00:00:00 2001 From: Dave Date: Sat, 25 Apr 2020 17:33:52 -0400 Subject: [PATCH] Fix problem with Radarr identifying reverse-symlinked files as new, and potentially overwriting movies as a result --- Custom-Post-Processing-Scripts.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Custom-Post-Processing-Scripts.md b/Custom-Post-Processing-Scripts.md index 03168db..0f728d2 100644 --- a/Custom-Post-Processing-Scripts.md +++ b/Custom-Post-Processing-Scripts.md @@ -180,8 +180,17 @@ while [[ $PERMFILESIZE != $ORIGFILESIZE ]]; do done if [[ $PERMFILESIZE == $ORIGFILESIZE ]]; then + # Save current time stamps to prevent radarr from identifying our simlink as new, and double-processing it + LINKDIR=$(dirname "$LINKPATH") + FOLDER_DATE=$(date -r "$LINKDIR" +@%s.%N) + FILE_DATE=$(date -r "$LINKPATH" +@%s.%N) + rm "$LINKPATH" ln -s "$PERMPATH" "$LINKPATH" + + touch --no-create --no-dereference --date "$FILE_DATE" "$LINKPATH" + touch --no-create --no-dereference --date "$FILE_DATE" "$PERMPATH" + touch --no-create --no-dereference --date "$FOLDER_DATE" "$LINKDIR" fi ```