I have Synology 214play NAS device. I created a script containing amc script. Just two lines.
#!/bin/sh
filebot -script fn:amc --log-file amc.log --action move --conflict skip -non-strict -r --def "movieFormat=/volume1/video/movies/{n.upperInitial().space('.')}.({y})/{n.upperInitial().space('.')}.{y}" music=n subtitles=tr artwork=y "ut_dir=/volume1/video/downloads" "ut_kind=single" "ut_state=5" "ut_file=" "ut_label="
If I run this script in terminal it works. But if I put this script in Task Scheduler of NAS it doesn't work and I could not find a log that explains the reason. I thought it was because of the " character so I tried to run another script;
#!/bin/sh
filebot -list --db thetvdb --q Dexter --log-file amc.log
Same problem. Works in the terminal and doesn't work if I run it from Task Scheduler.
Can anyone help?
Synology Task Scheduler problem
Re: Synology Task Scheduler problem
I found the reason. It is the java path. In filebot.sh file I put the full path of java and it worked.
Re: Synology Task Scheduler problem
Running commands from the login shell is not the same as using Synology DSM Task Scheduler or cron because they'll not initialise with ~/.profile so PATH may be different.
The very first thing you wanna do is to see what's going on. So make sure to redirect stdout AND stderr.

It's probably that "java" is added to the PATH via ~/.profile (not included by cron) but not linked to /usr/bin (naturally included by cron) so you'll get a "java: command not found"
Re: Synology Task Scheduler problem
Yes I got the java not found error. As you said java is added to the PATH via ~/.profile. I managed to solve the problem by giving the full path to java in filebot.sh. Thank you.
Re: Synology Task Scheduler problem
hi all
sorry for resuming this old post
I have the exact same problem, but - in my perpetual noob status - I'm missing the final step to solve it
I checked where java is with "which java"
I made a copy of filebot.sh and modified the line (currently line 65) startin with "java" adding the full path
Now, where is the right place to put it? back into /usr/local/filebot, maybe with a different name? or will this mess up updates?
thank you very much!
sorry for resuming this old post
I have the exact same problem, but - in my perpetual noob status - I'm missing the final step to solve it
I checked where java is with "which java"
I made a copy of filebot.sh and modified the line (currently line 65) startin with "java" adding the full path
Now, where is the right place to put it? back into /usr/local/filebot, maybe with a different name? or will this mess up updates?
thank you very much!
Re: Synology Task Scheduler problem
If you modify filebot.sh then it'll break with every update. You need to symlink your java executable to /usr/local/bin/java and then filebot.sh will be able to just call "java".