Running FileBot from the console, Groovy scripting, shell scripts, etc
Vippis
Posts: 8 Joined: 25 Jan 2013, 13:24
Post
by Vippis » 10 Sep 2014, 20:54
Hi,
I use filebot on a Synology Diskstation DS213+. I installed Filebot 4.2 using Rednoah's SPK Packages. In advance I use pyload to download stuff.
I use a filebot hook for pyload from guys from the pyload forum:
http://forum.pyload.org/viewtopic.php?f ... b&start=90
Although I think the commands are properly set filebot is not working after downloads are finished. If I enter the same command pyload calls filebot with via SSH it's working like a charm.
I really don't know how to fix the error. It seems that filebot is not even runned by pyload because there is no amc.log file created.
This is how pyload calls filebot:
Code: Select all
filebot -script fn:amc -non-strict --log-file amc.log -r --conflict override --action move --output /volume1/ --lang de --def clean=y skipExtract=y reportError=n artwork=n subtitles=de movieFormat='Filme/{n}({y})' seriesFormat='Serien_MCE/{n}/Staffel {s}/{n} - {s00e00} - {t}' musicFormat='music/{n}' /volume1/pyload/downloads/download.serienjunkies.org_f-5b3c2ebce48bcdd9_ul_outlanderAL101.html
Can you help me?
rednoah
The Source
Posts: 23936 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 11 Sep 2014, 05:55
So what's the output? First thing is to make sure you redirect stdout and stderr so you can see the output.
Besides, you're passing in a single html file? The script will ignore that and do nothing.
poloNes
Posts: 10 Joined: 21 Sep 2014, 21:28
Post
by poloNes » 21 Sep 2014, 21:44
Hello ,
I installed on my Synology DS213 FileBot .
Accessing through putty command works perfectly.
I'm very noob , I'm not getting put in the scheduler Synology tasks .
Could you help me ?
Sorry by my English because is not my first language , I speak Portuguese.
rednoah
The Source
Posts: 23936 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 22 Sep 2014, 04:22
Running a command this way is different from shell. PATH / PROFILE / etc won't be initialized so it might not be able to find "filebot" or "java".
The first thing you wanna do is to redirect standard & error output to file so you can see what's not working.
PS: i can't read anything on that screenshot... can you?
poloNes
Posts: 10 Joined: 21 Sep 2014, 21:28
Post
by poloNes » 22 Sep 2014, 09:23
Sorry for the image in Portuguese .
New images in English.
What is the command ?
thanks for help.
poloNes
Posts: 10 Joined: 21 Sep 2014, 21:28
Post
by poloNes » 22 Sep 2014, 17:59
Could create the script but does not work on the Synology scheduler tasks .
filebotsuball.sh
Code: Select all
#!/bin/sh
/volume1/@appstore/filebot/filebot.sh -script fn:suball --lang pob --def maxAgeDays=21 /volume1/video/Series
I think it must be some problem in task scheduler .
The script works perfectly for putty .
By task scheduler does not work .
I will keep searching until you find the problem .
Thank you .
rednoah
The Source
Posts: 23936 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 22 Sep 2014, 18:11
The first thing you REALLY wanna do is to redirect standard & error output to file so you can see what's not working.
poloNes
Posts: 10 Joined: 21 Sep 2014, 21:28
Post
by poloNes » 22 Sep 2014, 20:14
rednoah wrote: The first thing you REALLY wanna do is to redirect standard & error output to file so you can see what's not working.
Says not possible to find the java
Code: Select all
/volume1/@appstore/filebot/filebot.sh: line 35: java: not found
Code: Select all
#!/bin/sh
PRG="$0"
# resolve relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
# make it fully qualified
WORKING_DIR=`pwd`
PRG_DIR=`dirname "$PRG"`
APP_ROOT=`cd "$PRG_DIR" && pwd`
# restore original working dir
cd "$WORKING_DIR"
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]
then
export LD_LIBRARY_PATH="$APP_ROOT:$LD_LIBRARY_PATH"
else
export LD_LIBRARY_PATH="$APP_ROOT"
fi
# force JVM language and encoding settings
export LANG=en_US.utf8
java -Djava.awt.headless=true -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=spk -Dapplication.analytics=true -Dnet.filebot.AcoustID.fpcalc=fpcalc "-Dapplication.dir=$APP_ROOT" "-Djava.io.tmpdir=$APP_ROOT/temp" "-Duser.home=$APP_ROOT" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory "-Dnet.filebot.util.prefs.file=$APP_ROOT/prefs.properties" -jar "$APP_ROOT/FileBot.jar" "$@"
rednoah
The Source
Posts: 23936 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 22 Sep 2014, 20:25
Running a command this way is different from shell. PATH / PROFILE / etc won't be initialized so it might not be able to find "filebot" or "java".
I know. I guess you'll need to export PATH in your script, like the login shell would have done via ~/.profile
rednoah
The Source
Posts: 23936 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 22 Sep 2014, 20:25
Running a command this way is different from shell. PATH / PROFILE / etc won't be initialized so it might not be able to find "filebot" or "java".
I know. I guess you'll need to export PATH in your script, like the login shell would have done via ~/.profile
poloNes
Posts: 10 Joined: 21 Sep 2014, 21:28
Post
by poloNes » 22 Sep 2014, 20:52
rednoah wrote: Running a command this way is different from shell. PATH / PROFILE / etc won't be initialized so it might not be able to find "filebot" or "java".
I know. I guess you'll need to export PATH in your script, like the login shell would have done via ~/.profile
I find out the Root's .profile, so I copy below. E saw that there is the path for java as you can see, but It doesn't work yet.
Thank you for helping me.
Code: Select all
umask 022
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
export PATH
#This fixes the backspace when telnetting in.
#if [ "$TERM" != "linux" ]; then
# stty erase
#fi
HOME=/root
export HOME
TERM=${TERM:-cons25}
export TERM
PAGER=more
export PAGER
PS1="`hostname`> "
alias dir="ls -al"
alias ll="ls -la"
PATH=$PATH:/volume1/@appstore/java8/ejdk1.8.0_06/linux_arm_sflt/jre/bin # Synology Java Package
TZ='America/Sao_Paulo' # Synology Java Package
export PATH TZ # Synology Java Package
poloNes
Posts: 10 Joined: 21 Sep 2014, 21:28
Post
by poloNes » 22 Sep 2014, 22:51
I have edited the last line of the file filebot.sh, replacing java by the full path:
/volume1/@appstore/java8/ejdk1.8.0_06/linux_arm_sflt/jre/bin/ java
Now its is working , I can use that way or will I have a problem?
Code: Select all
/volume1/@appstore/java8/ejdk1.8.0_06/linux_arm_sflt/jre/bin/java -Djava.awt.headless=true -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding=UTF-8 -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=spk -Dapplication.analytics=true -Dnet.filebot.AcoustID.fpcalc=fpcalc "-Dapplication.dir=$APP_ROOT" "-Djava.io.tmpdir=$APP_ROOT/temp" "-Duser.home=$APP_ROOT" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory "-Dnet.filebot.util.prefs.file=$APP_ROOT/prefs.properties" -jar "$APP_ROOT/FileBot.jar" "$@"