Synology Task Scheduler problem

Any questions? Need some help?
Post Reply
maon
Posts: 14
Joined: 16 Oct 2014, 09:05

Synology Task Scheduler problem

Post 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?
maon
Posts: 14
Joined: 16 Oct 2014, 09:05

Re: Synology Task Scheduler problem

Post 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.
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Synology Task Scheduler problem

Post 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"
:idea: Please read the FAQ and How to Request Help.
maon
Posts: 14
Joined: 16 Oct 2014, 09:05

Re: Synology Task Scheduler problem

Post 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.
chiarac
Posts: 7
Joined: 20 May 2015, 18:13

Re: Synology Task Scheduler problem

Post 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!
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Synology Task Scheduler problem

Post 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".
:idea: Please read the FAQ and How to Request Help.
Post Reply