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.

Cache_Dirs in an unRAID V5.0 Plugin

Featured Replies

This is an unRAID V5.0 Plugin which is essentually a wrapper for the cache_dirs script written by Joe L (http://lime-technology.com/forum/index.php?topic=4500.0). This plugin will automatically start the cache_dirs script on mounting of the array. It have a settings page for easy configuration of the script.

 

Installation:

create a directory called "plugins" at the root of your unraid USB key and copy the .plg file into it.

 

Run:

The plugin script will automatically run when the unRAID server starts up.

However, it you want to start the plugin without rebooting, either go to the console or telnet into the server

at the prompt, type

installplg /boot/plugins/cache_dirs-0.7-1jr.plg

 

Please report any problems with the plugin here. If you have specific issues or feature requests for the cache_dirs script, please direct them here http://lime-technology.com/forum/index.php?topic=4500.0

 

Files: Updated to V0.7 (2012-05-03)

plugin file: http://dl.dropbox.com/u/73389880/cache_dirs-files/cache_dirs-0.7-1jr.plg

 

Change Log:

V0.7 - 2012-05-03 - Bug Fix, Corrected a type in the rc.cache_dirs script.

V0.6 - 2012-05-02 - Bug Fix, Corrected an error in the rc.cache_dirs script that was causing an error for some people.

V0.5 - 2012-05-01 - Bug Fix, fixed include and exclude directory bug. Thanks mp328 for pointing it out.

V0.4 - 2012-04-30 - Bug Fix, Corrected a bug in the cleanup script

V0.3 - 2012-04-27 - First Public release of the plugin

 

Screenshots:

cache_dirs-1-settings_menu.png

 

cache_dirs-3-configuration_menu.PNG

would something like this work without the pro / plus versions?

I do not think it has anything to do with the license of unRAID itself.  (certainly cache_dirs itself does not)

 

It should work fine.

  • Author

would something like this work without the pro / plus versions?

I have played around with the script and the plugin in the basic version of unRAID without any problems. As Joe L said, licencing should not be an issue. It does however have to be unRAID V5.0. Version 4.7 does not support this plugin type. I have only tested it with V5.0 B14.

Does having an entry in the include directorys then mean it will only scan those directories on no other

Does having an entry in the include directorys then mean it will only scan those directories on no other

 

correct

 

and exclude works the opposite way, everything BUT .... directory

  • 2 months later...

couple of things:

 

The icon for cachedirs doesn't show up for me (minor inconvenience)

 

more importantly: How do I know if cachedirs is actually caching? should browsing my plex clients keep my array spinned down until I select a file?

 

(plex settings are on a Non array disk, completely separate. mounted by SNAP)

... How do I know if cachedirs is actually caching?

 

From a command line (telnet or ssh) into your unRAID, run the command top

 

Here is some output from my system from top with cache_dirs plugin installed.

 

2 things to note:

*a lot of memory is showing used (over 7GB of 8GB total - cache_dirs is caching files into RAM)

*cache_dirs command running under COMMAND (usually will find it multiple times)

[pre]

root@tower:~#top

 

top - 11:37:36 up 4 days, 19:15,  1 user,  load average: 3.34, 3.12, 3.13

Tasks: 151 total,  2 running, 149 sleeping,  0 stopped,  0 zombie

Cpu(s):  5.6%us, 14.2%sy,  1.8%ni, 78.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st

Mem:  8309752k total,  7487420k used,  822332k free,  123448k buffers

Swap:        0k total,        0k used,        0k free,  3516476k cached

 

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                       

19498 root      20  0 85312 5972  604 S  37  0.1  2241:38 shfs                                         

27180 root      20  0 1181m  57m    0 S    3  0.7 542:57.18 VBoxHeadless                                 

5784 root      20  0  2264  576  484 R    3  0.0  0:00.08 find                                         

19595 root      20  0  4692 2684  460 S    1  0.0  7:57.65 cache_dirs                                   

    3 root      20  0    0    0    0 S    0  0.0  4:21.47 ksoftirqd/0                                   

    9 root      20  0    0    0    0 S    0  0.0  4:19.48 ksoftirqd/1                                   

5060 root      20  0  2472 1020  756 R    0  0.0  0:00.11 top                                           

19584 root      20  0  4644 2724  548 S    0  0.0  5:48.70 cache_dirs                                   

19588 root      20  0  4644 2724  548 S    0  0.0  5:48.07 cache_dirs

[/pre]

 

press q to exit from top back to your command line.

thanks,

 

I'm not at all new to linux and I understand top and all that.

 

thing is, it's not always on top, so my question is, how do I know when it's actually cached?

 

And also about the memory usage, the memory will be used up regardless of cachedirs, cachedirs isn't what takes it up, it's the system who takes the memory and assigns it to buffer (as indicated by the 'free' command)

 

but  yeah the thing I want to know is how do I know if my caches are updated, without ls-ing around and watching disk spinups

thanks,

 

I'm not at all new to linux and I understand top and all that.

 

thing is, it's not always on top, so my question is, how do I know when it's actually cached?

 

And also about the memory usage, the memory will be used up regardless of cachedirs, cachedirs isn't what takes it up, it's the system who takes the memory and assigns it to buffer (as indicated by the 'free' command)

 

but  yeah the thing I want to know is how do I know if my caches are updated, without ls-ing around and watching disk spinups

Well, if you used the version I wrote, you can run it in the foreground and see what it does.    (I've no idea if the plugin has that capability, as a copy of it was used for it.)

 

The basic concept is to keep the information nodes that represent the directories in the disk cache by accessing them frequently.    cache_dirs loops every 3 to 10 seconds, performing a listing of all the directories on each user-share in turn, sending the results to /dev/null.  The idea is to keep accessing the disk blocks in memory, and not have them become the least recently used (and subsequently re-used for something else)

 

In any case, Try

cache_dirs -q

folowed by

cache_dirs -vF

Joe L.

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.