(transmission-daemon) Compress Completed Torrents

Ask for help and report issues with the GTK+ version of Transmission
Post Reply
Posts: 5
Joined: Wed Mar 30, 2011 7:31 am

(transmission-daemon) Compress Completed Torrents

Post by Tohuw »

I'm not sure where the best place would be to post this question, but I'm working with the following environment:
  • Ubuntu Server 10.04
    transmission-daemon version 1.92 as provided by the Ubuntu 10.04 default repositories
My goal is to create a script to run when a torrent is completed to compress all files that torrent downloaded. The reason is simply because this is a remote server, and I want to be able to conveniently grab all of the files from the torrent by downloading one compressed archive. My questions are:
  1. Is the script action for completed torrents implemented in this version, or do I need to upgrade?
    Is there an environment variable for the actual files the torrent downloaded to the download directory? I didn't see one, and I could see how that would be difficult for Transmission to determine...
    Assuming that Transmission doesn't have a built-in mechanism capable of executing this, does anyone have any ideas or an existing implementation of this facility?
A simple point in the right direction would be most helpful. I've been playing with a few cron scripting ideas, but the tricky part is knowing when it should execute and making sure it doesn't treat the same downloads multiple times. So far, I had the idea of spawning text files when a torrent is complete to notify the cron script, but I can't figure a way to link those text files to the right downloaded files unless someone has an answer to my second question above.

I'd be grateful for any input. Thanks!
Posts: 272
Joined: Wed May 05, 2010 2:12 am

Re: (transmission-daemon) Compress Completed Torrents

Post by gunzip »

you would need Transmission version 2.00 or higher to run a script on download completion.

Code: Select all

if [ -e "$TR_TORRENT_DIR/$TR_TORRENT_NAME" ]; then
tar cfz "${TR_TORRENT_NAME}.tar.gz" "$TR_TORRENT_NAME"
something like above would give you a "torrent-name.tar.gz" file in your download directory. this is only a basic outline .. if you do it test on some small torrents first.
Post Reply