Page 1 of 1
AMC transmission-daemon script won't work
Posted: 21 Sep 2015, 09:21
by lospo
Hi and good morning,
i've installed OpenElec (last stable 5.0.8) and i've configured transmission-daemon to run a script when torrent is done.
the script: (placed in /storage/transpp.sh)
Code: Select all
#!/bin/bash
filebot -script fn:amc --output "$HOME/Media" --log-file amc.log --action duplicate --conflict override -non-strict --def music=y artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
after save i run:
Code: Select all
chmod +rx /storage/transpp.sh
chmod 777 /storage/transpp.sh
and, at last, i configured transmission (settings.json)
Code: Select all
"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/storage/transpp.sh",
I can see in the log that transmission-daemon call the script, but nothing happends.
If i run the file manually, it works. (i can verify because filebot create a log at every launch.)
In OpenElec there is only one user: root, so i don't think it could be a permission issue.
Does anyone know why?
Re: AMC transmission-daemon script won't work
Posted: 21 Sep 2015, 09:44
by rednoah
I'd start by adding some logging to your transpp.sh so you can make sure that it is actually called.
e.g.
Once you've made sure that filebot is definitely called, but doesn't start you can add some more logging:
Code: Select all
filebot -script fn:amc ...... > out.log 2> err.log
FileBot is either started successfully, or the shell will spit out some errors.
Re: AMC transmission-daemon script won't work
Posted: 21 Sep 2015, 12:56
by lospo
Here is the new modified file transpp.sh:
Code: Select all
#!/bin/bash
whoami > /storage/user.log
filebot -script fn:amc --output "/var/media/SCARICO/MC" --log-file amc.log --action duplicate --conflict override -non-strict --def music=y artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME" > /storage/out.log 2> /storage/err.log
in my /storage/user.log
and no out.log or err.log.
Now i'm really confused
Re: AMC transmission-daemon script won't work
Posted: 22 Sep 2015, 07:18
by rednoah
Add more logging:
Does filebot work?
Code: Select all
filebot -version > /storage/version.log 2>&1
Does filebot scripting work?
Code: Select all
filebot -script fn:sysinfo > /storage/sysinfo.log 2>&1
What's the ENVIRONMENT look like?
Code: Select all
filebot -script fn:sysenv > /storage/env.log 2>&1
And make sure your shell script is correct. And that "filebot" is actually filebot.

Re: AMC transmission-daemon script won't work
Posted: 23 Sep 2015, 11:15
by lospo
After a while (chmod dirs, files copy and paste part of code, and so on) i reached something,
now i have err.log with this inside:
and i have also out.log (with same date/time) but it is blank
Now i have to go to work, this evening i will do the other thing you write above.
Thank you!
Re: AMC transmission-daemon script won't work
Posted: 23 Sep 2015, 12:53
by rednoah
Did you edit filebot.sh at some point? Just making sure the filebot startup script isn't broken... cause I'm running out of ideas!
Re: AMC transmission-daemon script won't work
Posted: 23 Sep 2015, 13:13
by lospo
rednoah wrote:Did you edit filebot.sh at some point? Just making sure the filebot startup script isn't broken... cause I'm running out of ideas!
no, why?
java is linked in /usr/local/bin and every user can use that, and when i try filebot from anywhere it can run.
I will check this too
Re: AMC transmission-daemon script won't work
Posted: 23 Sep 2015, 22:11
by lospo
My ideas are finishing.
Code: Select all
which filebot
/usr/bin/filebot
chmod 777 -R /usr/bin/filebot
which java
/usr/local/bin/java
chmod 777 -R /usr/local/bin/
My filebot.sh
Code: Select all
#!/bin/sh
APP_ROOT="/usr/share/filebot"
APP_DATA="$HOME/.filebot"
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]
then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APP_ROOT"
else
export LD_LIBRARY_PATH="$APP_ROOT"
fi
java -Dunixfs=false -DuseGVFS=false -DuseExtendedFileAttributes=true -DuseCreationDate=false
-Djava.net.useSystemProxies=false -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000
-Djna.nosys=true -Dapplication.deployment=deb "-Dapplication.dir=$APP_DATA" "-Djava.io.tmpdir=$APP_DATA/temp"
"-Dnet.filebot.AcoustID.fpcalc=$APP_ROOT/fpcalc" -jar "$APP_ROOT/FileBot.jar" "$@"
my postprocess
Code: Select all
#!/bin/bash
filebot -script fn:amc --output "/media/DWL/MC" --log-file amc.log --action duplicate --conflict override -non-strict --def music=y artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME" > /media/DWL/out.log 2>/media/DWL/err.log
for some reason i can launch transpp.sh from console with no errors, but i cannot launch from transmission-daemon.
if i change my postprocess to this:
Code: Select all
#!/bin/bash
filebot -version > /media/DWL/out.log 2>/media/DWL/err.log
works, in my out.log i have
Code: Select all
FileBot 4.6 (r3052) / Java(TM) SE Runtime Environment 1.8.0_60 (headless)
I hope you have some ideas better than mine.
Re: AMC transmission-daemon script won't work
Posted: 24 Sep 2015, 12:43
by lospo
Change linux distro (now i'm on kodibuntu), same trouble.
Is it a malediction?
My postprocess file:
Code: Select all
#!/bin/bash
echo filebot -script fn:amc --output "/media/DWL/MC" --log-file /media/DWL/amc.log --action duplicate --conflict override -non-strict --def music=y artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME">/media/DWL/ech.log
filebot -script fn:amc --output "/media/DWL/MC" --log-file /media/DWL/amc.log --action duplicate --conflict override -non-strict --def music=y artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME">/media/DWL/out.log 2>/media/DWL/err.log
My /media/DWL/amc.log file
my /media/DWL/ech.log
Code: Select all
filebot -script fn:amc --output /media/DWL/MC --log-file /media/DWL/amc.log --action duplicate --conflict override -non-strict --def music=y artwork=y ut_dir=/media/DWL/Scaricati/Mr.Robot.S01E07.HDTV.x264-DEFiNE[ettv] ut_kind=multi ut_title=Mr.Robot.S01E07.HDTV.x264-DEFiNE[ettv]
my /media/DWL/err.log
my /media/DWL/out.log
Please someone help me
Re: AMC transmission-daemon script won't work
Posted: 24 Sep 2015, 16:06
by rednoah
You could try using the portable package.
Maybe a there's a few environment variables that are required in the filebot.sh launcher that are somehow not defined in the minimal cron environment?
Re: AMC transmission-daemon script won't work
Posted: 25 Sep 2015, 10:06
by lospo
rednoah wrote:You could try using the portable package.
Maybe a there's a few environment variables that are required in the filebot.sh launcher that are somehow not defined in the minimal cron environment?
I don't know but with the portable package and a few tweaks it works really good, at the first attempt.
Thank you @rednoah, i cannot do this without you