[mR] Forums
Cloud Cleaner - Printable Version

+- [mR] Forums (https://mikes-revenge.net)
+-- Forum: Revenge Forums (https://mikes-revenge.net/forumdisplay.php?fid=5)
+--- Forum: General Chat (https://mikes-revenge.net/forumdisplay.php?fid=93)
+---- Forum: Development (https://mikes-revenge.net/forumdisplay.php?fid=21)
+----- Forum: General Development (https://mikes-revenge.net/forumdisplay.php?fid=94)
+----- Thread: Cloud Cleaner (/showthread.php?tid=3305)



Cloud Cleaner - .Lb - 08-13-2014

Wrote a bash script for linux that cleans up movies, music and such that are older than a certain amount of days. Perfect for seedboxes. It deletes Cams and Tele Syncs older than 30 days and Webrips after 60 days. It then emails the log of what was done to me.
I scheduled this with a cron job to run cleanup once a week.

Code:
#/bin/bash
#run loop for each file in the directory
echo "Ran cleanup on cloud" > /tmp/mail_report.log
cd /var/www/rtorrent/complete/
find ./movies/ -iname '*cam.*' -mtime +30 >> /tmp/mail_report.log
find ./movies/ -iname '*cam *' -mtime +30 >> /tmp/mail_report.log
find ./movies/ -name '*TS *' -mtime +30 >> /tmp/mail_report.log
find ./movies/ -iname '*HDTS*' -mtime +30 >> /tmp/mail_report.log
find ./movies/ -iname '*HDCAM*' -mtime +30 >> /tmp/mail_report.log
find ./movies/ -iname '*HD-TS*' -mtime +30 >> /tmp/mail_report.log
find ./movies/ -iname '*WEBRIP*' -mtime +60 >> /tmp/mail_report.log
find ./movies/ -iname '*WEB-RIP*' -mtime +60 >> /tmp/mail_report.log
find ./movies/ -iname '*WEBDL*' -mtime +60 >> /tmp/mail_report.log
find ./movies/ -iname '*WEB-DL*' -mtime +60 >> /tmp/mail_report.log
find ./tele/ -iname '*' -mtime +90 >> /tmp/mail_report.log
find ./applications/ -iname '*' -mtime +60 >> /tmp/mail_report.log
find ./games/ -iname '*' -mtime +90 >> /tmp/mail_report.log
find ./music/ -iname '*' -mtime +120 >> /tmp/mail_report.log
find ./movies/ -iname '*' -mtime +120 >> /tmp/mail_report.log
find ./others/ -iname '*' -mtime +90 >> /tmp/mail_report.log


find ./movies/ -iname '*cam.*' -mtime +30 -exec rm -rf {} \;
find ./movies/ -iname '*cam *' -mtime +30 -exec rm -rf {} \;
find ./movies/ -name '*TS *' -mtime +30 -exec rm -rf {} \;
find ./movies/ -iname '*HDTS*' -mtime +30 -exec rm -rf {} \;
find ./movies/ -iname '*HDCAM*' -mtime +30 -exec rm -rf {} \;
find ./movies/ -iname '*HD-TS*' -mtime +30 -exec rm -rf {} \;
find ./movies/ -iname '*WEBRIP*' -mtime +60 -exec rm -rf {} \;
find ./movies/ -iname '*WEB-RIP*' -mtime +60 -exec rm -rf {} \;
find ./movies/ -iname '*WEBDL*' -mtime +60 -exec rm -rf {} \;
find ./movies/ -iname '*WEB-DL*' -mtime +60 -exec rm -rf {} \;
find ./tele/ -iname '*' -mtime +90 -exec rm -rf {} \;
find ./applications/ -iname '*' -mtime +60 -exec rm -rf {} \;
find ./games/ -iname '*' -mtime +90 -exec rm -rf {} \;
find ./music/ -iname '*' -mtime +120 -exec rm -rf {} \;
find ./movies/ -iname '*' -mtime +120 -exec rm -rf {} \;
find ./others/ -iname '*' -mtime +90 -exec rm -rf {} \;
df -h >> /tmp/mail_report.log
mail -s .CloudReport. [email protected] -- -f Cleanup < /tmp/mail_report.log &



RE: Cloud Cleaner - mIKe - 08-13-2014

Niiiice!


RE: Cloud Cleaner - Ackros - 08-14-2014

nice

I 'm still on plex but I got the chromecast which supports it on the TV now.


RE: Cloud Cleaner - .Lb - 08-14-2014

Seedbox.com's vps is way better than the seedboxes.
I was able to install plexserver straight to it and run it parallel with rtorrent, working on making it completely automated and adding different interfaces in html
Click Photo To Enlarge


RE: Cloud Cleaner - Videowarrior - 08-19-2014

I don't seed torrents.


RE: Cloud Cleaner - .Lb - 08-19-2014

(08-19-2014, 05:11 PM)Videowarrior Wrote: I don't seed torrents.

lame


RE: Cloud Cleaner - mIKe - 08-20-2014

(08-19-2014, 05:11 PM)Videowarrior Wrote: I don't seed torrents.

Thief!


RE: Cloud Cleaner - maxx237 - 08-20-2014

seed till ya bleed !