Page 1 of 1

NAS File Permissions

Posted: 23 Mar 2014, 10:00
by Nostalgist92
I've got FileBot running on my NAS pretty much exactly the way i want it but each time a file is renamed the permissions get changed to 666.

I've tried putting this in the command:

Code: Select all

"exec=chmod 775 "{file}""
Also tried

Code: Select all

"exec=chmod 775 -R "{folder}""
Both spit out this:

Code: Select all

Execute: chmod -R 775 /mnt/Storage/Media/Videos/TV/Criss Angel Mindfreak (2005)/Season 3
Syntax error: "(" unexpected
I can't figure out how to get it to ignore the brackets in the folder + file names.

Any ideas?

Re: NAS File Permissions

Posted: 23 Mar 2014, 11:31
by rednoah
It's not about brackets, it's about spaces in the name and not using quotes.

Look at this carefully. Doesn't it look odd to you? How does shell handle multiple "..."..."..." and what does actually get passed in?

Code: Select all

"exec=chmod 775 -R "{folder}""
Lets find out!

Code: Select all

$ echo "exec=chmod 775 -R "{folder}""
exec=chmod 775 -R {folder}
Oh! Surprise! Exactly like in the error message! The quotes are missing!

Solution 1:

Code: Select all

$ echo "exec=chmod 775 -R \"{folder}\""
exec=chmod 775 -R "{folder}"
Solution 2:

Code: Select all

$ echo "exec=chmod 775 -R '{folder}'"
exec=chmod 775 -R '{folder}'

Re: NAS File Permissions

Posted: 24 Mar 2014, 03:30
by Nostalgist92
Awkward moment i even though of solution 2 with using the ' ' but ended up not testing..

Anyway thanks for the help. Proves just how tired when i was doing it considering i missed something else that was pretty simple as well.

Using just:

Code: Select all

"exec=chmod 775 -R '{folder}'"
will just spit out "No such file or directory"

What's needed is:

Code: Select all

"exec=chmod 775 -R '{folder}/'"
Dat trailing slash...

Cheers again!

Re: NAS File Permissions

Posted: 24 Mar 2014, 03:44
by Nostalgist92
Also just throwing one more thing in there, the way my media is set up also requires a change in the ownsership of the files as well which can be done with:

Code: Select all

"exec=chmod 775 '{folder}/' ; chown owner:group '{folder}/'"
For the folder + subdir or

Code: Select all

"exec=chmod 775 '{file}' ; chown owner:group '{file}'"
For just the file that was renamed/moved