Using Automator to make your life with Transmission easier

I have two computers: a Macbook with Snow Leopard, that sometimes I carry with me, and a computer at home with an Atom processor and running Linux that is my media server and downloader. If I need to download something that will take too much time, I put this second computer to download: it has a good connection and it’s always online.

It has Transmission running with its great web interface activated. If I need to download some torrent file, I open its web interface and upload the .torrent file. Good, but… it could be easier.

If you download torrent files very often, the easiest way is to use the watch-dir feature from Transmission: every torrent that you put at some directory is automatically downloaded by Transmission. So, all I needed to do was copying the torrent files from my Macbook to my home server, using SFTP.

To configure your Transmission watch-dir, you must stop the Transmission service (I’m running the transmission-daemon version) and edit the settings.json file, inserting the following settings:

"watch-dir": "/home/mediaserver/transmission/watch",
"watch-dir-enabled": true

Remember: you must stop Transmission service, edit the file and start it again!

It works, but… It can be even easier, I thought. And I remembered of Automator, a good piece of software that comes with Snow Leopard, and that I knew but never used before.

The idea was: every time a new .torrent file is written at my laptop’s download directory, it should be copied to my home server.

So I opened Automator and created a new Folder Action:

At the top of the new workflow, I selected my Downloads folder:

 The next step in our flow is to create a script to copy our files via SSH to the computer that’s running Transmission. Use Utilities -> Run Shell Script to make it:

Now add the following content as the script’s source code. To make it work automatically, I allow my SSH server to receive connections using keys, not passwords. Don’t forget to change the scp’s destination to your computer’s host and directory:

for f in "$@"
	ext=`basename "$f" | awk -F "." '{ print $NF }'`
	if [ "$ext" == "torrent" ]; then
		scp "$f"

That’s it! Save your workflow and test it. Now, every time you click at a torrent file and download it, Transmission will download it automatically.

6 Responses

  1. Matt Darcey July 22, 2016 / 8:25

    Wow! Such a great trick for download torrent. Sometimes I face this problem but now I can realise from it. Thanks a lot for sharing this tricks with us. I hope people will be benefited by reading this post.

  2. uk bestessay September 25, 2016 / 9:22

    The new way of the using this automated this is looking a good one. From the side of the information as you write about that this is looking very nice. People will enjoy allot while sharing the different opinions about this.

  3. n songs January 4, 2017 / 8:19

    Good article thanks for sharing.

  4. gloriarwalton May 15, 2017 / 15:13

    It looks great to download torrents. I am tired of using proxies and other advertisements software to download torrent. But by using shell script i think it's so easy to download torrent file. I use microleaves Dedicated proxies to download torrents file but i think it is very helpful.

  5. 人気の売れ筋商品を多数取り揃えております。全て激安特価でご提供.お願いします.

  6. 70-410 dumps February 17, 2018 / 4:53

    It has Transmission running with its great web interface activated.

Leave a Reply

Your email address will not be published. Required fields are marked *