May 19, 201412 yr Right now I have a script in /etc/cron.daily/ named mycron.sh It check directories for files and directories over "X" days old and deletes them recursively. It makes the whole system MUCH more like a DVR for a media center. I think one of the biggest appeals of unRAID to people is that it's so easy to use through a web based menu driven system. I have no idea how to even BEGIN making a plugin. What I think would be very useful would be a plugin that you can give directories too (or browse for them ideally), and specify how much time to save them, and any other options, etc, and it would basically create little script and place it into the appropriate cron folder to execute. Also, folders that newbies don't watch and tend to get out of control like /mnt/cache/Apps/Downloads/complete/ and /mnt/cache/Apps/Downloads/incomplete/ can be added by default or something to keep those from piling up and using unnecessary space. Does anyone else have any interest on making this easier? I know it's not very hard to write a short cron script, but I'm embarrassed to say it took me a couple of days of googling before I figured out how to do it. Then add it to the editable files via the GUI so it's still fairly easy to control now, although some dropdowns and choices through the GUI via a .plg would be AWESOME! Anybody else think this would be a cool feature?
May 19, 201412 yr I was planning on making a "recycle bin" plugin for unraid, but this also kind of overlaps with the same settings and such. No guarantees, but i'll have a look at it in the near future.
May 19, 201412 yr Author That would be awesome! It doesn't seem like it would be that hard to do but what do I know. I'm getting close moving to your nzbdrone plugin soon. Thanks for the interest Phaze!
May 19, 201412 yr Author If anyone cares or would like it, this is my script now for deleting shows. It's located at: /etc/cron.daily/mycron.sh #!/bin/bash find "/mnt/user/media/TV Shows/Law & Order Special Victims Unit/"* -type d -ctime +30 -exec rm -rf {} \; find /mnt/user/media/TV\ Shows/CSI\ Crime\ Scene\ Investigation/* -type d -ctime +30 -exec rm -rf {} \; find /mnt/user/media/TV\ Shows/Parks\ and\ Recreation/* -type d -ctime +30 -exec rm -rf {} \; find /mnt/user/media/TV\ Shows/Community/* -type d -ctime +30 -exec rm -rf {} \; find /mnt/user/media/TV\ Shows/Real\ Time\ with\ Bill\ Maher/* -type d -ctime +30 -exec rm -rf {} \; find /mnt/user/media/TV\ Shows/The\ Colbert\ Report/* -type d -ctime +7 -exec rm -rf {} \; find /mnt/user/media/TV\ Shows/The\ Daily\ Show\ with\ Jon\ Stewart/* -type d -ctime +7 -exec rm -rf {} \; find /mnt/user/media/TV\ Shows/Last\ Week\ Tonight\ with\ John\ Oliver/* -type d -ctime +30 -exec rm -rf {} \; find /mnt/cache/Apps/Downloads/complete/movies/* -type d -ctime +5 -exec rm -rf {} \; find /mnt/cache/Apps/Downloads/complete/tv/* -type d -ctime +5 -exec rm -rf {} \; find /mnt/cache/Apps/Downloads/incomplete/* -type d -ctime +5 -exec rm -rf {} \; It will return errors on any of these lines when the directories are empty but it shouldn't hurt anything. The # immediately after the "+" is how many days old it checks for.
May 19, 201412 yr Author If I knew anything about coding.....it seems as though a plugin would be simple though. 1. Ask for directory 2. Ask how many days to check for 3. ask how often to run it. the plugin can create a script by simply adding the lines above and subbing in the directory name, # of days, and place in either cron.daily, or cron.monthly etc. Right?
May 19, 201412 yr Would also be nice if it could remove .AppleDB and .Appledouble files also. These are created when you access a share using a Mac. EDIT.....here is a script that someone made for me to help remove them if that helps. Remove the .txt extension remove_apple.sh.txt
Archived
This topic is now archived and is closed to further replies.