Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

REQUEST: Auto Delete Script from within GUI

Featured Replies

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?

+1

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.

  • 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!

  • 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.

  • 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?

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

  • Author

If you know all the directories involved it should be pretty simple

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.