Page 1 of 1

Synology Task Scheduler problem

Posted: 16 Oct 2014, 13:24
by maon
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?

Re: Synology Task Scheduler problem

Posted: 16 Oct 2014, 14:18
by maon
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

Posted: 16 Oct 2014, 14:27
by rednoah
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.


Image


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

Posted: 16 Oct 2014, 14:55
by maon
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

Posted: 06 Jul 2018, 17:28
by chiarac
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!

Re: Synology Task Scheduler problem

Posted: 06 Jul 2018, 19:11
by rednoah
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".