filebot works in Terminal, doesn´t work from sh script

Any questions? Need some help?
Post Reply
denkler
Donor
Posts: 5
Joined: 09 May 2014, 21:43

filebot works in Terminal, doesn´t work from sh script

Post by denkler »

Hi all,

I struggled installing filebot, flexget and pyload on my QNAP NAS as I am a unix noob.
All in all it´s now working well, except, that filebot only runs from shell.

When I run the following from shell, it works and I am VERY happy about the magic of filebot:

Code: Select all

filebot -script fn:amc "/share/MD0_DATA/Download/pyload/The Daily Show 2014 05 08 Katie Couric 720p HDTV x264-LMAO" --output "/share/MD0_DATA/Py/" --conflict override -non-strict --action move --def "movieFormat=Movies/{net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, Locale.GERMAN).name} {'('+y+')'}/{net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, Locale.GERMAN).name} {'('+y+')'}" clean=y artwork=n >> /share/MD0_DATA/FileBot/log.log
But when this command is executed by a shell script that is triggerd / executed by pyload "package_finished", it won´t do anything.
It doesn´t even log anything, no info, warnings, errors, nothing.
The same when I don´t use ">>" but the "log-file" filebot command.

Not even a

Code: Select all

filebot -version >>  /share/MD0_DATA/FileBot/log.log
does anything - when executed by the shell script.

Can anyone hint me in a direction? How can I debug anything without log entries...?
Every idea appreciated.

Cheers




btw, here´s my setup:
- QNAP NAS
- pyload installed as QPKG package
- JRE 7 installed as QPKG package
java -version output:

Code: Select all

[/] # java -version
java version "1.7.0_45"
Java(TM) SE Embedded Runtime Environment (build 1.7.0_45-b15, headless)
Java HotSpot(TM) Embedded Client VM (build 24.45-b08, mixed mode)
[/] # 
- filebot 4.0
filebot -version output:

Code: Select all

[/] # filebot -version
FileBot 4.0 (r2056) / Java(TM) SE Embedded Runtime Environment 1.7.0_45 (headless)

[/] # 
User avatar
rednoah
The Source
Posts: 23933
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: filebot works in Terminal, doesn´t work from sh script

Post by rednoah »

>> only redirect standard output, not error output, so you will never see any errors, which most likely is that it can't find the filebot command because it's running as a different user or with a different bash profile.

@see http://www.filebot.net/forums/viewtopic.php?f=8&t=1558
:idea: Please read the FAQ and How to Request Help.
denkler
Donor
Posts: 5
Joined: 09 May 2014, 21:43

Re: filebot works in Terminal, doesn´t work from sh script

Post by denkler »

Hi Rednoah,

thanks for the links, really helpfull!

But I have the same behaviour with

Code: Select all

filebot -script fn:amc "/share/MD0_DATA/Download/pyload/The Daily Show 2014 05 08 Katie Couric 720p HDTV x264-LMAO" --output "/share/MD0_DATA/Py/" --conflict override -non-strict --action move --def "movieFormat=Movies/{net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, Locale.GERMAN).name} {'('+y+')'}/{net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, Locale.GERMAN).name} {'('+y+')'}" clean=y artwork=n --log-file "/share/MD0_DATA/FileBot/log.txt" --log all
executed from the shell script --> nothing, manually executed in terminal -> works great and logs stuff.

Nevertheless I´ll try it with "2>>" and report back.

Edit:
And I´ll try to check the bash profile / users as soon as I know how that works :)
denkler
Donor
Posts: 5
Joined: 09 May 2014, 21:43

Re: filebot works in Terminal, doesn´t work from sh script

Post by denkler »

Hey,

2>> did the trick...!

I could finally see what was happening:

First the filebot programm wasn´t found

Code: Select all

/share/MD0_DATA/.qpkg/pyload/scripts/package_finished/filebotTest.sh: line 3: filebot: command not found
After adding the full path to filebot program in the script:

Code: Select all

/share/MD0_DATA/FileBot/filebot: line 7: java: command not found
So I edited the filebot file, called java with the full path from it and now everything is working great!


Don´t know why I have to use the full pathes although the $PATH variable is set - always thought that´s the whole point about the $PATH variable to not need to call full program paths...


Thank you very much Rednoah, great program and awesome support - even for the newbs.
Little donation is on its way.

8SA85184YD4661120
Post Reply