Running FileBot from the console, Groovy scripting, shell scripts, etc
Nostalgist92
Posts: 3 Joined: 23 Mar 2014, 09:51
Post
by Nostalgist92 » 23 Mar 2014, 10:00
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:
Also tried
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?
rednoah
The Source
Posts: 23939 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 23 Mar 2014, 11:31
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?
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}'
Nostalgist92
Posts: 3 Joined: 23 Mar 2014, 09:51
Post
by Nostalgist92 » 24 Mar 2014, 03:30
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:
will just spit out "No such file or directory"
What's needed is:
Dat trailing slash...
Cheers again!
Nostalgist92
Posts: 3 Joined: 23 Mar 2014, 09:51
Post
by Nostalgist92 » 24 Mar 2014, 03:44
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