SHOW:
|
|
- or go back to the newest paste.
1 | #!/bin/bash | |
2 | - | # Remove unionFS hidden files created by Radarr removing older content |
2 | + | # Remove unionFS hidden files created by Sonarr removing older content |
3 | # Add script to crontab by typing crontab -e and pasting the line below (without # in front ) | |
4 | - | # * * * * * /home/scripts/logs/fuse-delete-m.cron >/dev/null 2>&1 |
4 | + | # * * * * * /home/scripts/logs/fuse-delete-tv.cron >/dev/null 2>&1 |
5 | - | # Make script executable with: chmod a+x /home/scripts/logs/fuse-delete-m.cron |
5 | + | # Make script executable with: chmod a+x /home/scripts/logs/fuse-delete-tv.cron |
6 | ||
7 | - | logfile="/home/scripts/logs/fuse-delete-m.cron.log" |
7 | + | logfile="/home/scripts/logs/fuse-delete-tv.cron.log" |
8 | ||
9 | - | if pidof -o %PPID -x "fuse-delete-m.cron"; then |
9 | + | if pidof -o %PPID -x "fuse-delete-tv.cron"; then |
10 | - | echo "$(date "+%d.%m.%Y %T") EXIT: fuse-delete-m.cron already running." |
10 | + | echo "$(date "+%d.%m.%Y %T") EXIT: fuse-delete-tv.cron already running." |
11 | exit 1 | |
12 | fi | |
13 | ||
14 | - | find /home/plex/fuse-m/.unionfs-fuse -name '*_HIDDEN~' | while read line; do |
14 | + | find /home/plex/fuse-tv/.unionfs-fuse -name '*_HIDDEN~' | while read line; do |
15 | - | oldPath=${line#/home/plex/fuse-m/.unionfs-fuse} |
15 | + | oldPath=${line#/home/plex/fuse-tv/.unionfs-fuse} |
16 | - | newPath=m-gd:${oldPath%_HIDDEN~} |
16 | + | newPath=tv-gd:${oldPath%_HIDDEN~} |
17 | echo "$(date "+%d.%m.%Y %T") REMOVED $newPath" | tee -a "$logfile" | |
18 | rclone delete "$newPath" | |
19 | - | rm "$line" |
19 | + | rm -f "$line" |
20 | done | |
21 | - | find "/home/plex/fuse-m/.unionfs-fuse" -mindepth 1 -type d -empty -delete |
21 | + | find "/home/plex/fuse-tv/.unionfs-fuse" -mindepth 1 -type d -empty -delete |
22 | exit |