Code: Select all
[DEBUG ] 04:35:56 alertmanager:123 torrent_finished_alert: << torrent name >> torrent finished downloading
[DEBUG ] 04:35:56 alertmanager:123 state_changed_alert: << torrent name >>: state changed to: finished
[DEBUG ] 04:35:56 alertmanager:123 state_changed_alert: << torrent name >>: state changed to: seeding
[DEBUG ] 04:35:56 alertmanager:123 tracker_announce_alert: << torrent name >> (udp://tracker.openbittorrent.com:80) sending announce (completed)
[DEBUG ] 04:35:56 torrentmanager:869 on_alert_torrent_finished
[DEBUG ] 04:35:56 torrentmanager:875 << torrent id >> is finished..
[DEBUG ] 04:35:56 rpcserver:466 intevents: {4426: ['TorrentRemovedEvent', 'PluginEnabledEvent', 'TorrentAddedEvent', 'PluginDisabledEvent', 'TorrentStateChangedEvent', 'ConfigValueChangedEvent']}
[DEBUG ] 04:35:56 core:111 [execute] Running commands for complete
[DEBUG ] 04:35:56 core:127 [execute] running /home/deluge/complete.sh
[ERROR ] 04:35:56 eventmanager:59 Event handler TorrentFinishedEvent failed in <function event_handler at 0x1f976e0>
Also, I have tested my script, and it works always when invoked from the command line, and sometimes when run from deluge.
I'm running deluge 1.3.5 on ubuntu server 10.04 LTS
anyone have any ideas?
PS, I don't think it's relevant, but here's the script i'm running:
Code: Select all
#!/bin/bash
torrentid="$1"
torrentname="$2"
torrentpath="$3"
localpath="/home/deluge/"
remotepath="/path/to/remote/files/"
scpresume="rsync --partial --progress --inplace --rsh=ssh"
retries=0
result=1
torrentfullpath="$torrentpath/$torrentname"
echo "\"${torrentfullpath}\""
#remove the /home/deluge part of the full path.
torrentdest=${torrentfullpath#$localpath}
#now add the remote path to the torrentdest
torrentdest="${remotepath}${torrentdest}"
#get the directory name only for the destination
torrentdest=`dirname "${torrentdest}"`
#escape spaces.
torrentdest="${torrentdest// /\ }"
#torrentfullpath="${torrentfullpath// /asdfasdf}"
echo "log for $torrentname, $torrentid" >> /home/deluge/lastxfer.txt
starttime=`date +%s`
date
echo starttime: $starttime
until (( retries>60 || result==0 ))
do
#wait a little longer each time.
sleep $((retries/2))m
(( retries += 1 ))
echo "try #${retries}" >> /home/deluge/lastxfer.txt
echo $scpresume -r "'${torrentfullpath}'" user@sshserver:"${torrentdest}/" >> /home/deluge/lastxfer.$
eval $scpresume -r "\"$torrentfullpath\"" user@sshserver:"${torrentdest}/"
result=$?
done
if (( result != 0 ))
then
echo "scp never completed sucesssfully" >> /home/deluge/lastxfer.txt
else
endtime=`date +%s`
date
echo entime: $endtime
totaltime=$((endtime-starttime+1))
echo totaltime: $totaltime
size=`du -s "$torrentfullpath"`
set -- $size
size=$1
echo "removing $torrentname" >> /home/deluge/lastxfer.txt
echo $torrentid
echo $? >> /home/deluge/lastxfer.txt
avgspeed=$((size/totaltime))
echo -e "Subject: $torrentname finished\nTo: email@addres.com\nDate: `date`\nFrom: email@address.com\n\nfile $
fi
echo "" >> /home/deluge/lastxfer.txt