@Tim, thanks.
I have a new script now which will clean up Transmission (removing the resume and torrent files) when it moves the download to your desired location. The only prerequisite is that you must use a separate directory for partial downloads (set "incomplete-dir-enabled" to true in /var/lib/transmission/.config/transmission-daemon/settings.json)
| Code: |
#!/bin/bash
TRANSMISSIONHOMEPATH=/home/transmission # You need to set this to Transmission's home path
DOWNLOADPATH=/home/transmission/Downloads # You need to set this to Transmission's download path
DOWNLOADDESTINATION=/shares/shared/Downloads # You need to set this to where you want to move the files to
TORRENTPATH=$TRANSMISSIONHOMEPATH/.config/transmission-daemon/torrents/
RESUMEPATH=$TRANSMISSIONHOMEPATH/.config/transmission-daemon/resume/
if [ "$(ls -A $DOWNLOADPATH)" ] ; then
service transmission-daemon stop > /dev/null
cd $DOWNLOADPATH || exit 1
for TORRENTNAME in *; do
chown :howitts "$TORRENTNAME" -R # Changes the group owner of the download. You need to change this.
chmod 774 "$TORRENTNAME" -R # Changes permissions of the download
mv "$TORRENTNAME" "$DOWNLOADDESTINATION"
for TORRENT in "$TORRENTPATH$TORRENTNAME"*.torrent; do # remove the .torrent file
rm "$TORRENT"
done
for TORRENT in "$RESUMEPATH$TORRENTNAME"*.resume; do #remove the .resume file
rm "$TORRENT"
done
done
service transmission-daemon start
fi
|
Note I stop Transmission if there are any files to move then restart it at the end. This is all a bit of a kludge and there should be a much cleaner way of doing it using
Transmission's own API but that is way beyond me.
[edit]Forgot to say, place script in /etc/cron.hourly. You may also need to give it execute permission.[/edit]