Deluge execute not running filebot in bash script
Posted: 14 Nov 2013, 01:46
I am very confused. I am running deluge on linux using the deluged daemon as a service with its own user named deluge. I have it set to execute the following bash script when torrents complete using the execute deluge plugin:
This script works perfectly when I run it myself. It also works when I run it as the deluge user using "sudo -u deluge sh" and then running it in that shell. However, if it is run by deluge because a torrent completed, it seems that the filebot portion of the script is skipped. Both echo messages are added to the log, but the filebot messages are not logged and the files are not linked in the output directory. Below is an example of log output when I run it as the deluged user:
As you can see it works just as it should and the files are successfully linked. However here is an example of log output when deluge runs the script after I delete the hardlink created above:
Everything related to the filebot command is missing.
What makes the problem even more confusing is when I ran deluged -L debug (as deluge user) to try to figure out what is going on, deluge execute worked perfectly successfully hardlinking the files automatically. The only explanation I could come up with was that something in my bash environment is different than when deluged is run as a service, but all I could think of that that might effect is whether filebot is on my path. As you can see in my script I set it to run /usr/bin/filebot so the path should not affect anything.
The script works when run by any method other than deluged running as a service calling it when a torrent completes. What could possibly be causing the filebot command to be ignored?
Code: Select all
#!/bin/bash
TORRENT_ID=$1
TORRENT_NAME=$2
TORRENT_PATH=$3
echo "`date` $3/$2" >> /srv/deluge/deluge-pp.log
/usr/bin/filebot -script fn:amc --output "/run/mount/Data/Videos" --action hardlink --conflict skip -non-strict --def subtitles=n artwork=n backdrops=n "ut_title=$TORRENT_NAME" "seriesFormat=Shows/{n}/Season {s}/s{s}e{e} - {t}" "movieFormat=Movies/{n}" music=n plex=localhost "$TORRENT_PATH/$TORRENT_NAME" >> /srv/deluge/deluge-pp.log
echo "`date` done" >> /srv/deluge/deluge-pp.log
Code: Select all
Wed Nov 13 20:14:23 EST 2013 /run/mount/Data/Downloads/!/Arrested.Development.S01E01.Pilot.720p.H.264.Web.DL-McXode.mkv
Parameter: subtitles = n
Parameter: artwork = n
Parameter: backdrops = n
Parameter: ut_title = Arrested.Development.S01E01.Pilot.720p.H.264.Web.DL-McXode
.mkv
Parameter: seriesFormat = Shows/{n}/Season {s}/s{s}e{e} - {t}
Parameter: movieFormat = Movies/{n}
Parameter: music = n
Parameter: plex = localhost
Argument: /run/mount/Data/Downloads/!/Arrested.Development.S01E01.Pilot.720p.H.264.Web.DL-McXode.mkv
Input: /run/mount/Data/Downloads/!/Arrested.Development.S01E01.Pilot.720p.H.264.Web.DL-McXode.mkv
Group: [tvs:Arrested Development] => [Arrested.Development.S01E01.Pilot.720p.H.264.Web.DL-McXode.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Arrested Development]
Fetching episode data for [Arrested Development]
[HARDLINK] Rename [/run/mount/Data/Downloads/!/Arrested.Development.S01E01.Pilot.720p.H.264.Web.DL-McXode.mkv] to [/run/mount/Data/Videos/Shows/Arrested Development/Season 1/s1e1 - Pilot.mkv]
Processed 1 files
Notify Plex: localhost
Done ヾ(@⌒ー⌒@)ノ
Wed Nov 13 20:14:28 EST 2013 done
Code: Select all
Wed Nov 13 20:22:10 EST 2013 /run/mount/Data/Downloads/!/Arrested.Development.S01E01.Pilot.720p.H.264.Web.DL-McXode.mkv
Wed Nov 13 20:22:10 EST 2013 done
What makes the problem even more confusing is when I ran deluged -L debug (as deluge user) to try to figure out what is going on, deluge execute worked perfectly successfully hardlinking the files automatically. The only explanation I could come up with was that something in my bash environment is different than when deluged is run as a service, but all I could think of that that might effect is whether filebot is on my path. As you can see in my script I set it to run /usr/bin/filebot so the path should not affect anything.
The script works when run by any method other than deluged running as a service calling it when a torrent completes. What could possibly be causing the filebot command to be ignored?