Multiple Watch Folders?

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

Multiple Watch Folders?

Postby molachai » Fri Jan 21, 2011 3:10 am

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?

Postby Tickitata » Sat Feb 12, 2011 11:38 pm

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?

Postby wolf451man » Sun Mar 06, 2011 1:56 am

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: 94
Joined: Sat Jan 31, 2009 6:31 pm

Re: Multiple Watch Folders?

Postby metaclam » Wed Jan 18, 2012 8:28 pm

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?

Postby HeLo » Sun May 06, 2012 11:59 am

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

x190
Posts: 5095
Joined: Sun Nov 30, 2008 4:59 am

Re: Multiple Watch Folders?

Postby x190 » Sun May 06, 2012 6:50 pm

The stone age didn’t end because we ran out of stones.
---The Great Disruption - by Paul Gilding
https://paulgilding.com/
-------------------------------------------------

achmetinternet
Posts: 1
Joined: Thu May 23, 2013 6:38 am

Re: Multiple Watch Folders?

Postby achmetinternet » Thu May 23, 2013 6:39 am

+1, this is much needed!

taz
Posts: 3
Joined: Sun Oct 24, 2010 6:21 pm

Re: Multiple Watch Folders?

Postby taz » Tue Jul 09, 2013 1:36 pm

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?

Postby greggc2006 » Sat Jan 04, 2014 5:13 pm

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?

Postby hicham_chaaya » Thu Feb 06, 2014 9:38 am

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?

Postby dlbogdan » Fri Feb 28, 2014 6:39 pm

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?

Postby koesherbacon » Mon Oct 26, 2015 10:33 pm

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!

x190
Posts: 5095
Joined: Sun Nov 30, 2008 4:59 am

Re: Multiple Watch Folders?

Postby x190 » Tue Oct 27, 2015 3:02 am

Experiment! Start with this structure: /path/to/watchfolder/watch1, /path/to/watchfolder/watch2, /path/to/watchfolder/watch3, etc.

Now replace $1 in the script with '/path/to/watchfolder' without quotes.

http://linux.die.net/man/1/inotifywait

Let us know the results.
The stone age didn’t end because we ran out of stones.
---The Great Disruption - by Paul Gilding
https://paulgilding.com/
-------------------------------------------------


Return to “Mac Requests”