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.

mtime issues on user shares --> Plex scanning problem

Featured Replies

Hi,

 

The most recent releases of Plex seem to have updated their media scanner approach.  The new scanner is a "Turbo scanner" and looks for directory modification dates (mtime) to determine whether there is new media which needs to be scanned. 

 

As stormshaker pointed out, the mtime of directories in a user share aren't updated after creation, even though the directories on the drives themselves are.  As an example, if you add a file to TV_Show/Season_1/new.episode.mkv, the following mtimes are shown:

 

/mnt/disk1/TV/TV_Show/Season_1    3-26-11 (now)

/mnt/user/TV/TV_Show/Season_1    2-23-11 (when the directory was first created)

 

This means that new media added to a directory already created now is no longer being scanned by Plex.  Is anyone else encountering this issue?

 

You can by-pass the turbo scanner in Plex by doing a Option-Refresh in the media manager, but this means no more automatic updates.  The other option is to instead point Plex to the individual drives, but this somewhat negates the benefit of a user share.

 

Is there anything that can be done to get UnRaid to update the mtime of the directory in the user share?  Or are there any better ideas out there before I go changing paths and rescanning my whole library?

not sure as I have not tried it but maybe doing a touch of the /mnt/user/TV/TV_Show/Season_1 folder would do it.

 

do a google search for "touch linux command" if you don't quite understand what I am saying.

  • Author

Many thanks prostuff1 - I'll give touch a go to see if it work.

 

The trouble is that this would also need to be done manually for each updated directory... unless someone (who knows how to program in linux:) would write something that could be cron'd to search for files in directories newer than the associated folder, and touch the folder to update the mtime to the date of the latest file.

 

This is a bit of a messy workaround though, and will like cause regular spin-ups of the disks unnecessarily.

 

Would be grateful for any thoughts?

 

 

 

 

A shell script with a cron job could automate this task.

  • 1 year later...

Old thread but just want to mention that I had this issue and solved with a simple bash script i modified from a sickbeard forum. I read people saying using a cache drive or pointing plex to the disks directly solved their issues but not for me. Especially, when i moved my PMS from Mac to Windows which was much more sensitive to time stamps. This script basically allows you to modify the time stamps of the enclosing directories/folders using a touch command based off of the current time stamp of the associated file. You can choose how far up the path structure to modify. For example, my shows are in /Volumes/Media/TVShows/ and so for show Dexter it looks like /Volumes/Media/TVShows/Dexter/Season X/File X. The script uses the time stamp of the File X to modify the time stamps of the Season X and Dexter folders only. My Plex is set to watch the folder TVShows so it will always pick up in a scheduled Turbo Scan when I add a file to my UNRAID. I use Hazel on my mac to watch for when a file is added to my unRAID shares and then kick off the script on the added files.

 

#!/bin/sh
# set EXPATH to the top folder you do not want modified; everything after will be "touched"
# $1 is the path of the new download

EXPATH="/Volumes/Media/TVShows/"
CURPATH=$1
while [ `expr "$CURPATH" : "$EXPATH"` -gt 0 ]
do
#  echo "Touching $CURPATH"
  touch "$CURPATH"
  CURPATH=`dirname "$CURPATH"`
done

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.