Set UMASK globally or per folder?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
gene0915
Level 4
Level 4
Posts: 244
Joined: Sun Oct 26, 2014 7:52 pm

Set UMASK globally or per folder?

Post by gene0915 »

I noticed that with Mint 18.3, the default umask value was (I believe) 0002. With 19, it's 0022.

I have a script that runs and uses youtube-dl to grab video files and tosses them into /mnt/md0/YouTube where Plex can pick them up. Problem is, when YouTube-dl runs and places the videos files in the YouTube folder, Plex refuses to see them because they come over as rwxr--r--. If I issue the following command:

Code: Select all

sudo chmod -R 775 /mnt/md0/YouTube/
Plex can finally "see" all the newly downloaded files imports them into the library just fine. To make the default umask 0002, should I just add

Code: Select all

umask=0002
to the .bashrc file in my home dir and add that line into /etc/profile?

Or, is there a way to set some sort of default umask at the directory level so that ANY FILE OR FOLDER placed in /mnt/md0/whatever, gets added as 775?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Set UMASK globally or per folder?

Post by catweazel »

gene0915 wrote: Sat Aug 18, 2018 2:06 pm To make the default umask 0002, should I just add

Code: Select all

umask=0002
to the .bashrc file in my home dir and add that line into /etc/profile?
You can set umask in either of those places. I wouldn't try both at all, and I would only try /etc/profile if .bashrc didn't work on its own.

This might be helpful if .bashrc doesn't get read https://askubuntu.com/questions/929439/ ... untu-17-04
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Locked

Return to “Beginner Questions”