In transmission-daemon, downloaded torrents stay listed as long as they are not manually removed. In order to get them flushed automatically, the following command run by cron can help:
transmission-remote -l | grep 100% | grep Done | \
awk '{print $1}' | xargs -n 1 -I % transmission-remote -t % -r
In order to add this to cron
, the "%"-symbols have to be escaped with a leading slash like this:
*/5 * * * * /usr/bin/transmission-remote -l | grep 100\% | grep Done | awk '{print $1}' | xargs -n 1 -I \% /usr/bin/transmission-remote -t \% -r
An improvement on your solution ( though it works ).
For higher performance use :
/5 * * * * root transmission-remote -l | grep Done | awk ‘{print $1}’ | grep -o ‘[0-9]‘ | tr “\\n” “,” | xargs -n 1 -I % transmission-remote -t % -r
this avoids having to call transmission repeatedly and instead deletes everything in one go (:
Another way if you want to remove all torrents at once (assuming everything finished).
transmission-remote –auth user:pass -tall –remove