servo: transmission: torrent-done: implement a TR_NO_HARDLINK option

This commit is contained in:
2024-06-26 09:05:51 +00:00
parent 4b9dcd50fb
commit 6b117fa9bf

View File

@@ -7,6 +7,7 @@
# optionally: # optionally:
# - TR_DRY_RUN=1 # - TR_DRY_RUN=1
# - TR_DEBUG=1 # - TR_DEBUG=1
# - TR_NO_HARDLINK=1
DOWNLOAD_DIR=/var/media/torrents DOWNLOAD_DIR=/var/media/torrents
@@ -65,6 +66,9 @@ destructive find "$MEDIA_DIR/" -type f \(\
-o -iname 'YTS*.com.txt' \ -o -iname 'YTS*.com.txt' \
\) -exec rm {} \; \) -exec rm {} \;
# dedupe the whole media library. if ! [ -b "${TR_NO_HARDLINK}" ]; then
# yeah, a bit excessive: move this to a cron job if that's problematic. # dedupe the whole media library.
destructive hardlink /var/media --reflink=always --ignore-time --verbose # yeah, a bit excessive: move this to a cron job if that's problematic
# or make it run with only 1/N probability, etc.
destructive hardlink /var/media --reflink=always --ignore-time --verbose
fi