A dry run from FileBot Node:
Since it looks like FileBot doesn't have permission to create the excludes file, I shelled into the NAS and created it with touch filebot_amc.excludes.filebot -script 'fn:amc' /volume1/NAS/Downloads/complete/tv --output '/volume1/NAS/iTunes Library' --action TEST -non-strict --order Airdate --conflict auto --lang en --def 'ut_label=TV' 'music=y' 'unsorted=y' 'skipExtract=y' 'emby=localhost:******' 'pushover=******:******' 'excludeList=filebot_amc.excludes' --apply refresh --log all --log-file '/usr/local/filebot-node/data/filebot.log'
------------------------------------------
Run script [fn:amc] at [Thu Jun 18 13:09:46 AEST 2020]
Parameter: ut_label = TV
Parameter: music = y
Parameter: unsorted = y
Parameter: skipExtract = y
Parameter: emby = localhost:******
Parameter: pushover = *****
Parameter: excludeList = filebot_amc.excludes
Argument[0]: /volume1/NAS/Downloads/complete/tv
Use excludes: /volume1/NAS/iTunes Library/filebot_amc.excludes
java.io.IOException: Permission denied
java.io.IOException: Permission denied
at java_io_File$createNewFile$5.call(Unknown Source)
at Script1.run(Script1.groovy:151)
at net.filebot.cli.ScriptShell.evaluate(Unknown Source)
at net.filebot.cli.ScriptShell.runScript(Unknown Source)
at net.filebot.cli.ArgumentProcessor.runScript(Unknown Source)
at net.filebot.cli.ArgumentProcessor.run(Unknown Source)
at net.filebot.Main.main(Unknown Source)
Error (o_O)
------------------------------------------
After that, the dry run seems to run successfully, though of course it is not actually writing any files to the output directory (because it's a dry run), so the permissions issue is not apparent:
When I execute the task, though, I am once again unable to write the excludes file:filebot -script 'fn:amc' /volume1/NAS/Downloads/complete/tv --output '/volume1/NAS/iTunes Library' --action TEST -non-strict --order Airdate --conflict auto --lang en --def 'ut_label=TV' 'music=y' 'unsorted=y' 'skipExtract=y' 'emby=localhost:******' 'pushover=******:******' 'excludeList=filebot_amc.excludes' --apply refresh --log all --log-file '/usr/local/filebot-node/data/filebot.log'
------------------------------------------
Run script [fn:amc] at [Thu Jun 18 13:14:40 AEST 2020]
Parameter: ut_label = TV
Parameter: music = y
Parameter: unsorted = y
Parameter: skipExtract = y
Parameter: emby = localhost:******
Parameter: pushover = *****
Parameter: excludeList = filebot_amc.excludes
Argument[0]: /volume1/NAS/Downloads/complete/tv
Use excludes: /volume1/NAS/iTunes Library/filebot_amc.excludes (1)
Ignore hidden: /volume1/NAS/Downloads/complete/tv/.DS_Store
Ignore system path: /volume1/NAS/Downloads/complete/tv/@eaDir
Input: /volume1/NAS/Downloads/complete/tv/******/******.mkv
Input: /volume1/NAS/Downloads/complete/tv/******/******.mkv
Process as TV Series [TV]
Group: {Series=true} => [******.mkv, ******.mkv]
Rename episodes using [TheTVDB] with [Airdate Order]
Auto-detected query: [******]
Fetching episode data for [******]
Auto-detected query: [******]
Fetching episode data for [******]
[TEST] from [/volume1/NAS/Downloads/complete/tv/******/******.mkv] to [/volume1/NAS/iTunes Library/TV Shows/******/Season 07/******.mkv]
[TEST] from [/volume1/NAS/Downloads/complete/tv/******/******.mkv] to [/volume1/NAS/iTunes Library/TV Shows/******/Season 05/******.mkv]
Processed 2 files
Done ヾ(@⌒ー⌒@)ノ
Assuming the filebot process is running as the admin user on my Synology, it should have write access to the entire /volume1/NAS directory tree. Using the Synology File Station's Permission Inspector, I can see that the admin user does indeed have full Administration, Read, and Write permissions to the filebot_amc.excludes file, but checking via the shell tells a different story:filebot -script 'fn:amc' /volume1/NAS/Downloads/complete/tv --output '/volume1/NAS/iTunes Library' --action duplicate -non-strict --order Airdate --conflict auto --lang en --def 'ut_label=TV' 'music=y' 'unsorted=y' 'skipExtract=y' 'emby=localhost:******' 'pushover=******:******' 'excludeList=filebot_amc.excludes' --apply refresh --log all --log-file '/usr/local/filebot-node/data/filebot.log'
------------------------------------------
Run script [fn:amc] at [Thu Jun 18 13:33:06 AEST 2020]
Parameter: ut_label = TV
Parameter: music = y
Parameter: unsorted = y
Parameter: skipExtract = y
Parameter: emby = localhost:******
Parameter: pushover = *****
Parameter: excludeList = filebot_amc.excludes
Argument[0]: /volume1/NAS/Downloads/complete/tv
Use excludes: /volume1/NAS/iTunes Library/filebot_amc.excludes (1)
Ignore hidden: /volume1/NAS/Downloads/complete/tv/.DS_Store
Ignore system path: /volume1/NAS/Downloads/complete/tv/@eaDir
Failed to write excludes: /volume1/NAS/iTunes Library/filebot_amc.excludes: java.nio.file.AccessDeniedException: /volume1/NAS/iTunes Library/filebot_amc.excludes
Abort (×_×)
------------------------------------------
[Process error]
Exit Code: 4
I used chmod 664 to make it writable by the users group, but that did not change the behaviour.sentience@diskstation:/volume1/NAS/iTunes Library$ ls -l filebot_amc.excludes
-rw-r--r-- 1 sentience users 0 Jun 18 13:12 filebot_amc.excludes
I used chmod 666 and that allowed the process to progress, but ran into a similar permissions issue actually hard-linking the files into the destination directory.
Strangely, the failure to write the first file to the output directory seems to have caused FileBot to fall back to treating both files as “unsorted”, and FileBot successfully created a new Unsorted subdirectory and wrote the files there.filebot -script 'fn:amc' /volume1/NAS/Downloads/complete/tv --output '/volume1/NAS/iTunes Library' --action duplicate -non-strict --order Airdate --conflict auto --lang en --def 'ut_label=TV' 'music=y' 'unsorted=y' 'skipExtract=y' 'emby=localhost:******' 'pushover=******:******' 'excludeList=filebot_amc.excludes' --apply refresh --log all --log-file '/usr/local/filebot-node/data/filebot.log'
------------------------------------------
Run script [fn:amc] at [Thu Jun 18 13:45:34 AEST 2020]
Parameter: ut_label = TV
Parameter: music = y
Parameter: unsorted = y
Parameter: skipExtract = y
Parameter: emby = localhost:******
Parameter: pushover = *****
Parameter: excludeList = filebot_amc.excludes
Argument[0]: /volume1/NAS/Downloads/complete/tv
Use excludes: /volume1/NAS/iTunes Library/filebot_amc.excludes (1)
Ignore hidden: /volume1/NAS/Downloads/complete/tv/.DS_Store
Ignore system path: /volume1/NAS/Downloads/complete/tv/@eaDir
Input: /volume1/NAS/Downloads/complete/tv/******/******.mkv
Input: /volume1/NAS/Downloads/complete/tv/******/******.mkv
Process as TV Series [TV]
Group: {Series=true} => [******.mkv, ******.mkv]
Rename episodes using [TheTVDB] with [Airdate Order]
Auto-detected query: [******]
Fetching episode data for [******]
Auto-detected query: [******]
Fetching episode data for [******]
[DUPLICATE] from [/volume1/NAS/Downloads/complete/tv/******/******.mkv] to [/volume1/NAS/iTunes Library/TV Shows/******/Season 07/******.mkv]
cp: cannot create regular file ‘/volume1/NAS/iTunes Library/TV Shows/******/Season 07/******.mkv’: Permission denied
[DUPLICATE] Failure: java.nio.file.AccessDeniedException: /volume1/NAS/iTunes Library/TV Shows/******/Season 07/******.mkv
Processed 0 files
AccessDeniedException: /volume1/NAS/iTunes Library/TV Shows/******/Season 07/******.mkv
Processing 2 unsorted files
[DUPLICATE] from [/volume1/NAS/Downloads/complete/tv/******/******.mkv] to [/volume1/NAS/iTunes Library/Unsorted/******/******.mkv]
[DUPLICATE] from [/volume1/NAS/Downloads/complete/tv/******/******.mkv] to [/volume1/NAS/iTunes Library/Unsorted/******/******.mkv]
Processed 2 files
Notify Emby: [host:localhost, token:******]
POST: http://localhost:8096/Library/Refresh?api_key=******
Sending Pushover notification
Done ヾ(@⌒ー⌒@)ノ
------------------------------------------
[Process completed]
I see that the newly-written files are owned by admin:administrators; however, the admin user is definitely in both the administrators and users groups, so I would have expected it to be able to write to a 775 directory owned by sentience:users.
What is the recommended setup for enabling FileBot to write to my output directory without making all of the files/directories world-writable (666/777)?