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?