diff options
Diffstat (limited to 'odin/strm/cleanup_youtube')
-rw-r--r-- | odin/strm/cleanup_youtube | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/odin/strm/cleanup_youtube b/odin/strm/cleanup_youtube index 2d91fe1f..76c3f0bb 100644 --- a/odin/strm/cleanup_youtube +++ b/odin/strm/cleanup_youtube | |||
@@ -19,19 +19,7 @@ function cleanup { | |||
19 | 19 | ||
20 | urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } | 20 | urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } |
21 | 21 | ||
22 | dir=/srv/media/youtube | 22 | @rollingdirectory@/bin/rolling-directory /srv/media/youtube 50Gi |
23 | maxsize=$((1024 * 1024 * 1024 * 50)) | ||
24 | |||
25 | while [[ $(du -bs $dir | awk '{ print $1; }') -gt $maxsize ]]; do | ||
26 | find $dir -type f -not -path $dir/CACHEDIR.TAG -print0 | \ | ||
27 | xargs -0 -- stat --printf '%W %Y %Z %X %n\0' | \ | ||
28 | sort -t '\0' -z | \ | ||
29 | awk -F '\0' '{ gsub("^\\S+\\s+\\S+\\s+\\S+\\s+\\S+\\s+", "", $1); printf "%s\0", $1; }' | \ | ||
30 | xargs -0 -- rm -v | ||
31 | done | ||
32 | |||
33 | find $dir -xtype l -delete | ||
34 | find $dir -type d -empty -delete | ||
35 | 23 | ||
36 | notmuch search --output=messages --format=text 'is:cached' | \ | 24 | notmuch search --output=messages --format=text 'is:cached' | \ |
37 | while read id; do | 25 | while read id; do |