Multiple Watch Folders?

Feature requests for the Mac OS X version of Transmission
Post Reply
molachai
Posts: 4
Joined: Thu Jan 21, 2010 7:19 am

Multiple Watch Folders?

Post by molachai »

Hey there. Excellent program. I've been using it since I got my Mac.
I searched the forum and must have missed this if it was posted before.

Can you add to the Watch folders options and allow us to have multiple watch folders? I ask this because I have Safari set to download to one directory and Transmission watches that. I also want to use DropIt on my iPhone to auto start torrents on my machine when I'm away, but I'd have to change my watch folder to my Dropbox downloads, therefore breaking the auto-add from Safari.

Is this possible?

Thanks. :)
Tickitata
Posts: 1
Joined: Sat Feb 12, 2011 11:36 pm

Re: Multiple Watch Folders?

Post by Tickitata »

Registered to say that this is exactly the situation I'm in. It would be great for those of us who want to use both Safari and Dropbox to auto-start torrents.
wolf451man
Posts: 1
Joined: Sun Mar 06, 2011 1:51 am

Re: Multiple Watch Folders?

Post by wolf451man »

Created an account just to answer this for you.
Automator is your friend here.

Created an automator script that moves all .torrent files from downloads to your drop box.
Point transmission to your dropbox.

I do the same thing with my .nzb files for the newsgroups.
metaclam
Posts: 101
Joined: Sat Jan 31, 2009 6:31 pm

Re: Multiple Watch Folders?

Post by metaclam »

An automator script might be a solution, but I like the option within Transmission even better.
HeLo
Posts: 2
Joined: Sun May 06, 2012 11:56 am

Re: Multiple Watch Folders?

Post by HeLo »

metaclam wrote:An automator script might be a solution, but I like the option within Transmission even better.
This is on the Requested Features list already
achmetinternet
Posts: 1
Joined: Thu May 23, 2013 6:38 am

Re: Multiple Watch Folders?

Post by achmetinternet »

+1, this is much needed!
taz
Posts: 3
Joined: Sun Oct 24, 2010 6:21 pm

Re: Multiple Watch Folders?

Post by taz »

I have made a script in python to do this hope you can use it https://github.com/Tazaz/Transmission_M ... ch_Folders
greggc2006
Posts: 1
Joined: Sat Jan 04, 2014 4:58 pm

Re: Multiple Watch Folders?

Post by greggc2006 »

taz wrote:I have made a script in python to do this hope you can use it https://github.com/Tazaz/Transmission_M ... ch_Folders
Thanks for this taz, I just downloaded it from github and being a bit noobish have no clue how to use it, can you give a quick step by step?? I'm running Fluxbox on Ubuntu 13.04 if it makes a difference.

Thanks.
hicham_chaaya
Posts: 1
Joined: Thu Feb 06, 2014 9:28 am

Re: Multiple Watch Folders?

Post by hicham_chaaya »

Hi Guys,

I just downloaded this magnificent piece of software and I salute the team behind it.
As everyone was saying here, other known torrent softwares have the option to watch folders and a checkmark to watch subfolders as well.

If you could make that in your next release that will be amazing.

Keep on the good work.


Cheers!
dlbogdan
Posts: 3
Joined: Fri Feb 28, 2014 6:31 pm

Re: Multiple Watch Folders?

Post by dlbogdan »

Hi,

I've managed to write a simple script in 5 minutes (a bit dirty but it works) for adding the multiple folder watch functionality to transmission-daemon (on linux).
It's using inotify-tools.

Code: Select all

#!/bin/bash
inotifywait -q -r -m $1 --format %w%f -e create |
while read file; do
   if echo "$file" | grep -iq "\.torrent" ; then
     canonfile=$(readlink -f "$file")
     dir=$(dirname "$canonfile")
     if echo `basename "$file"` | grep -iq "^\._"; then
      echo
      else
      #echo "Waiting for the file to close"
      while : ; do 
        a=`stat -c%s "$canonfile"`
      sleep 0.5s
      if [ $a -gt 0 ]; then break; fi
      done
      while : ; do
        a=`stat -c%s "$canonfile"`
      sleep 5s
      if [ $a -eq `stat -c%s "$canonfile"` ]; then break; fi
      done
      transmission-remote -a "$canonfile" -w "$dir" 
      rm -f "$canonfile"
     fi
   fi
done
As always with watching files from an external process you never know when will it finish writing, given you have no signal from the writing process. So race conditions appears. I've mitigated that by watching file grow until it stops. I'm watching the file first get passed zero because in my experiments sometimes it will stay to zero for a couple of seconds before starting to grow.
No, using close_write event will not do it, for example samba will close and reopen the file multiple times during a transfer..
Note: This part " grep -iq "^\._";" is for filtering out the crap Mac OS X will write on a samba share along with the file you copy.

So basically you'll lunch this script from ex. /etc/rc.local with the parameter of the root folder you want to watch. It will recursively watch all the subfolders from then on for .torrents file. This script can be modified to watch only a specific folder (and ran multiple times with different folders to selectively watch a number of folders) by just modifying the first line "inotifywait -q -r -m $1 --format %w%f -e create |" by removing the "-r" parameter.

Cheers!
koesherbacon
Posts: 1
Joined: Mon Oct 26, 2015 7:33 pm

Re: Multiple Watch Folders?

Post by koesherbacon »

dlbogdan wrote:Hi,

Code: Select all

#!/bin/bash
inotifywait -q -r -m $1 --format %w%f -e create |
while read file; do
   if echo "$file" | grep -iq "\.torrent" ; then
     canonfile=$(readlink -f "$file")
     dir=$(dirname "$canonfile")
     if echo `basename "$file"` | grep -iq "^\._"; then
      echo
      else
      #echo "Waiting for the file to close"
      while : ; do 
        a=`stat -c%s "$canonfile"`
      sleep 0.5s
      if [ $a -gt 0 ]; then break; fi
      done
      while : ; do
        a=`stat -c%s "$canonfile"`
      sleep 5s
      if [ $a -eq `stat -c%s "$canonfile"` ]; then break; fi
      done
      transmission-remote -a "$canonfile" -w "$dir" 
      rm -f "$canonfile"
     fi
   fi
done
Cheers!
Hi, I'm very mew to Bash coding, and could use a little more information about this script... if anyone actually checks on this thread anymore since I'm about a year-and-a-half late to the discussion..

Anyway, what I'd like to know is how do I specify which folders in my Linux laptop? I'm running Antergos OS, version 2015.10.18 which is an Arch-based distribution and using Gnome3 / Gnome-Shell as my main desktop environment, if that makes any difference.

If anyone is able to help me better understand how this script works, I'd really like to use it so my Transmission can start to monitor more than just the one folder it currently does.

Thanks a lot!
Post Reply