Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Remove unionFS hidden files created by Radarr removing older content
- # Add script to crontab by typing crontab -e and pasting the line below (without # in front )
- # * * * * * /home/scripts/logs/fuse-delete-m.cron >/dev/null 2>&1
- # Make script executable with: chmod a+x /home/scripts/logs/fuse-delete-m.cron
- logfile="/home/scripts/logs/fuse-delete-m.cron.log"
- if pidof -o %PPID -x "fuse-delete-m.cron"; then
- echo "$(date "+%d.%m.%Y %T") EXIT: fuse-delete-m.cron already running."
- exit 1
- fi
- find /home/plex/fuse-m/.unionfs-fuse -name '*_HIDDEN~' | while read line; do
- oldPath=${line#/home/plex/fuse-m/.unionfs-fuse}
- newPath=m-gd:${oldPath%_HIDDEN~}
- echo "$(date "+%d.%m.%Y %T") REMOVED $newPath" | tee -a "$logfile"
- rclone delete "$newPath"
- rm "$line"
- done
- find "/home/plex/fuse-m/.unionfs-fuse" -mindepth 1 -type d -empty -delete
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement