All clients report it as offline (web, GTK, and console), however, I can run top and see that it is running, and is in a valid state.
once the script finishes, everything goes back to normal, except that if a torrent completed while the script was running, the newly completed torrent does NOT get the script executed on it.
I have run the script with the same command line options that deluge gives it, and the problems described above do not happen.
Code: Select all
#!/bin/bash
torrentid="$1"
torrentname="$2"
torrentpath="$3"
localpath="/home/deluge/"
remotepath="/home/remoteuser/media/"
scpresume="rsync --partial --progress --inplace --rsh=ssh"
retries=0
result=1
torrentfullpath="$torrentpath/$torrentname"
torrentdest=${torrentfullpath#$localpath}
torrentdest="${remotepath}${torrentdest}"
torrentdest=`dirname "${torrentdest}"`
echo "log for $torrentname" >> /home/deluge/lastxfer.txt
until (( retries>10 || result==0 ))
do
#wait a little longer each time.
sleep $((retries*10))m
(( retries += 1 ))
echo "try #${retries}" >> /home/deluge/lastxfer.txt
eval $scpresume -r "\"$torrentfullpath\"" username@destinationhost:"${torrentdest}/"
result=$?
done
if (( result != 0 ))
then
echo "scp never completed sucesssfully" >> /home/deluge/lastxfer.txt
fi
Code: Select all
/path/myscript.sh &