servo: transmission: remove noisy files upon torrent completion
This commit is contained in:
@@ -58,6 +58,7 @@ let
|
|||||||
# make the media rwx by anyone in the group
|
# make the media rwx by anyone in the group
|
||||||
destructive find "$MEDIA_DIR" -type d -exec setfacl --recursive --modify d:g::rwx,o::rx {} \;
|
destructive find "$MEDIA_DIR" -type d -exec setfacl --recursive --modify d:g::rwx,o::rx {} \;
|
||||||
destructive find "$MEDIA_DIR" -type d -exec chmod g+rw,a+rx {} \;
|
destructive find "$MEDIA_DIR" -type d -exec chmod g+rw,a+rx {} \;
|
||||||
|
|
||||||
# if there's a single directory inside the media dir, then inline that
|
# if there's a single directory inside the media dir, then inline that
|
||||||
subdirs=("$MEDIA_DIR"/*)
|
subdirs=("$MEDIA_DIR"/*)
|
||||||
if [ ''${#subdirs} -eq 1 ]; then
|
if [ ''${#subdirs} -eq 1 ]; then
|
||||||
@@ -66,6 +67,15 @@ let
|
|||||||
mv "$dirname"/* "$MEDIA_DIR/" && rmdir "$dirname"
|
mv "$dirname"/* "$MEDIA_DIR/" && rmdir "$dirname"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# remove noisy files:
|
||||||
|
find "$MEDIA_DIR/" -type f \
|
||||||
|
-iname 'www.YTS.*.jpg' \
|
||||||
|
-o -iname 'WWW.YIFY*.COM.jpg' \
|
||||||
|
-o -iname 'YIFY*.com.txt' \
|
||||||
|
-o -iname 'YTS*.com.txt' \
|
||||||
|
-exec rm {} \;
|
||||||
|
|
||||||
# dedupe the whole media library.
|
# dedupe the whole media library.
|
||||||
# yeah, a bit excessive: move this to a cron job if that's problematic.
|
# yeah, a bit excessive: move this to a cron job if that's problematic.
|
||||||
destructive hardlink /var/media --reflink=always --ignore-time --verbose
|
destructive hardlink /var/media --reflink=always --ignore-time --verbose
|
||||||
|
Reference in New Issue
Block a user