File permissions no longer automatically working

That output shown is 755 with +g applied. (4755 is the numeric value).
It is correctly assigning group plex.

The files in those directories should have 4644 (644 +g)
Sub directories should look exactly like this directory does.

what’s not working please ?

EDIT what is your umask command line output value ?

I move my video files into one of several sub folders under /home/plexmedia. After the move:

$ ls -la /home/plexmedia
total 306944
drwxr-sr-x 11 clay plex 4096 Jun 22 23:18 .
drwxr-xr-x 4 root root 4096 Jun 19 17:40 …
-rw------- 1 clay plex 314031491 Jun 22 16:12 'video file’
drwxr-sr-x 2 clay plex 4096 Jun 22 17:00 movies
drwxr-sr-x 2 clay plex 65536 Jun 19 23:11 music
drwxr-sr-x 2 clay plex 4096 Jun 19 17:40 pictures
drwxr-sr-x 2 clay plex 86016 Jun 21 14:24 stuff2
drwxr-sr-x 2 clay plex 20480 Jun 19 18:14 stuff3
drwxr-sr-x 2 clay plex 4096 Jun 19 18:14 stuff4
drwxr-sr-x 2 clay plex 12288 Jun 19 18:15 stuff5
drwxr-sr-x 2 clay plex 61440 Jun 21 13:49 stuff6
drwxr-sr-x 42 clay plex 4096 Jun 22 22:37 tvshows

Where did video file come from ? You ? Plex ?

Allow me to suggest?

If you have a tool, like Sonarr, there are options in those type programs which will forcibly set permissions to values like you show.

If accidentally turned on, and set to the wrong value, the values assigned by the automated permissions of the file system will be overridden.

Might this be the case here?

I download them using qBittorrent into a folder on one computer (Linux Mint 19.1, folder: 775, file: 664), copy them up to my NAS (I can’t find the folder or file permissions), and then move them into /home/plexmedia.

If you’re doing the copying, then it is indeed a setting in your user account (linux login).

This is a good starting point of how to resolve. The key points here are umask and permanently for your username.

It might have been an update or something you setup for another program which is colliding

The value you want is 022

This means 755 for directories and 644 for files. (the numerical inverse of the mask)

I looked in /etc/login.defs and it looks like umask is already set to 022.

Prefix these values with “0” to get octal, “0x” to get hexadecimal.
ERASECHAR 0177
KILLCHAR 025
UMASK 022

look in your home directory (.profile , .shrc , some user-specific ‘dot’ file).
This is with your individual settings.

My .profile in my home directory has this:

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

I looked in /etc/profile and there’s no umask setting so do I set it in the local profile or the global one?

You’ve shown both the system and your profile are correct.

What tool is performing the copy?
Is it being copied as sudo ?

You could also set your torrent to deposit directory.
Then, instead of copying, you could move (mv). This will preserve the 644.

I’m using the GUI to move the files around so not as sudo.

You’re suggesting that I download the files directly to the NAS folder instead of a local folder and then copying them to the NAS? But they’re 664 on my local folder so how would a move then make them 644?

Any idea what changed? My setup used to work for me with no issues and now I need to manually set the permissions so Plex can see and play them.

And since I haven’t said this in a while, thanks for all your help. I think maybe the easiest thing for me to do is set up an hourly cron job to fix the file permissions in my plexmedia folder. While I’m getting an education, I’m not sure we’re getting any closer to a fix but if you want to keep chasing this, I’m happy to give you whatever info you need.

I have my OTA captures (I live in a rural area with an actual antenna) and my captures are deposited directly on the NAS.

Knowing you are copying to the NAS, this also now makes me ask how is it mounted? NFS? SMB ? What are the mount options? SMB can make a mess of file permissions in a heartbeat.

Linux permissions do not transit SMB well at all and, now that I know this, may be the root cause. ext permissions over NFS is protocol native. SMB doesn’t understand/support what we’re doing here. SMB is singe user based. NFS is multi-user.

Here is my NFS mount line for movies. Be advised the UID for my username and plex matches on both systems so I can use sec=sys.

moesern:/volume1/movies                   /syno/movies   nfs defaults,sec=sys,intr,rw,vers=4,auto,async,bg 0 0

Sorry for the delay in replying.

I use SMB to connect to my NAS drive via Caja. I don’t mount it in my fstab.

Just wondering, I thought the Automating Linux Permissions settings would make it so that when I copy/move files into my plexmedia folder(s), the permissions would be set after the copy/move so why would it matter what SMB did to the file permissions on the NAS?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.