Multiple Watch Folders and Multiple Destinations.

simur612

Member
May 25, 2018
879
0
16
Hello, I have seen many permutations of a multiple watch directory setup, but nobody seems to want to do what I am trying to accomplish. I want it to be moved from the downloading directory (like a staging area) to a completed directory and then symlinked to yet another directory (for sickbeard,couchpotato,etc to process). I have that working, but it seems to run the torrent against EVERY rule I have specified. I will paste my commands so you get an idea what I mean.

The watch dir commands look like this
Quote
schedule = watch_directory_1,10,10,"load_start=/NAS/Torrents/Watch/Movies/*.torrent,d.set_custom3=/NAS/Torrents/Completed/Movies"

schedule = watch_directory_2,10,10,"load_start=/NAS/Torrents/Watch/Music/*.torrent,d.set_custom4=/NAS/Torrents/Completed/Music"

schedule = watch_directory_3,10,10,"load_start=/NAS/Torrents/Watch/TV/*.torrent,d.set_custom1=/NAS/Torrents/Completed/TV"

schedule = watch_directory_4,10,10,"load_start=/NAS/Torrents/Watch/Games/*.torrent,d.set_custom2=/NAS/Torrents/Completed/Games"

schedule = watch_directory_5,10,10,"load_start=/NAS/Torrents/Watch/Programs/*.torrent,d.set_custom2=/NAS/Torrents/Completed/Programs"​

#TV Shows
system.method.insert=checkdirs1,simple,"not=\"$equal={d.get_custom1=,d.get_base_path=}\""
system.method.insert=movecheck1,simple,"and={checkdirs1=,d.get_complete=,d.get_custom1=}"
system.method.insert=movedir1,simple,"d.set_directory=$d.get_custom1=;execute=mv,-f,$d.get_base_path=,$d.get_custom1=;d.set_custom1=;d.stop=;d.start="
system.method.insert=symdir1,simple,"d.set_directory=$d.get_custom1=;execute=cp,-afs,$d.get_base_path=,/NAS/Torrents/Completed/sickbeard_processing/;d.set_custom1="
system.method.set_key=event.download.hash_done,move_hashed1,"branch={$movecheck1=,movedir1=,symdir1=}"​
As you can see the symlink command has a specific destination so it goes to the right folder to process. My Movie command would look like this.
Quote
#Movies
system.method.insert=checkdirs3,simple,"not=\"$equal={d.get_custom3=,d.get_base_path=}\""
system.method.insert=movecheck3,simple,"and={checkdirs3=,d.get_complete=,d.get_custom3=}"
system.method.insert=movedir3,simple,"d.set_directory=$d.get_custom3=;execute=mv,-f,$d.get_base_path=,$d.get_custom3=;d.set_custom3=;d.stop=;d.start="
system.method.insert=symdir3,simple,"d.set_directory=$d.get_custom3=;execute=cp,-afs,$d.get_base_path=,/NAS/Torrents/Completed/couchpotato_processing/;d.set_custom3="
system.method.set_key=event.download.hash_done,move_hashed3,"branch={$movecheck3=,movedir3=,symdir3=}"​


So the problem is that the torrent will get ran against all these custom labels instead of the one it is intended for. I wish to have custom1 be TV and have the relevant section above only be run against it. Even sections that have no symlink command are symlinked.

#Programs/Games
system.method.insert=checkdirs2,simple,"not=\"$equal={d.get_custom2=,d.get_base_path=}\""
system.method.insert=movecheck2,simple,"and={checkdirs2=,d.get_complete=,d.get_custom2=}"
system.method.insert=movedir2,simple,"d.set_directory=$d.get_custom2=;execute=mv,-f,$d.get_base_path=,$d.get_custom2=;d.set_custom2=;d.stop=;d.start="
system.method.set_key=event.download.hash_done,move_hashed2,"branch={$movecheck2=,movedir2=}"​
That results in the file being moved to /NAS/Torrents/Completed/Games/ and then for whatever reason it symlinks to sickbeard_processing, and couchpotato_processing.

They are on hash atm so I can repeatedly test without burning my bandwidth btw. Any ideas? I could really use the help, it's driving me nuts. Thanks!

EDIT: There are no linebreaks in the real file.
 

peshua19

Member
May 25, 2018
897
0
16
Put all that logic in a bash script, emit the target path, capture that and use it in set_dir, be done much easier.
 

simur612

Member
May 25, 2018
879
0
16
I am terrible at bash scripting. Would you be able to do one of them that way I have an example to extrapolate to the rest of these items? Also how would rtorrent call the script? Thanks for answering pyro, much appreciated!