customizing watch folders in rtorrent

lisas4567

Member
May 25, 2018
773
0
16
I realize this is more an rtorrent issue than an rutorrent issue but from reading through these boards, people here seem like they would know the answer.

I have been trying to figure out how to set up watch folders but all the info I find simply points to the example given here which doesn't tell me anything about what those settings actually mean. What are the numbers for? do they have to be set at 10? Is it possible to set up a watch folder so that it will load the torrent but not start it, so I can click on it in rutorrent and edit things that need editing before starting it (like download path and specific files to ignore for example)?

I am brand new to Linux but when doing stuff like this, I like to learn what it is I'm doing so that next time I can apply some of what I've learned rather than just constantly asking and copying what others have done. Thanks for any help.

Desiree
 

simur612

Member
May 25, 2018
879
0
16
perhaps you should look into using the autowatch part of auto-tools.

It can be made to work with multi-level directories

for more info, search the forums on autotools


your link didn't work for me...they do not have to be set to 10, i think that's the minutes
 

lisas4567

Member
May 25, 2018
773
0
16
ok, I installed the auottools plugin but so far nothing seems to be working. I checked the box to anable autowatch features and set the directory to watch as /volume1/downloads/torrents and left unchecked the start automatically button as my whole purpose here is to get torrents to load but not start downloading. I have downloaded some .torrent files to my watch directory but nothing happens. what am I missing?
 

lisas4567

Member
May 25, 2018
773
0
16
do you have your command line php set up properly in rutorrent settings?
[feeling very stupid now]
I don't even know what that is

edit: ok, I found (one of) my errors - a misspelling in my watch folder name. now watch folders are working, but they automatically start downloading. how can I get them to load in a stopped state?

edit2: found a solution on another forum - just add this code to the rtorrent.rc file:
system.method.set_key = event.download.inserted_new,close_inserted,d.close=
 

peshua19

Member
May 25, 2018
897
0
16
[feeling very stupid now]
I don't even know what that is

edit: ok, I found (one of) my errors - a misspelling in my watch folder name. now watch folders are working, but they automatically start downloading. how can I get them to load in a stopped state?

edit2: found a solution on another forum - just add this code to the rtorrent.rc file:
system.method.set_key = event.download.inserted_new,close_inserted,d.close=
Try load=*.torrent instead of load_start=*.torrent
 

lisas4567

Member
May 25, 2018
773
0
16
Now that I think I have a handle on basic watch folder operation, I want to set up multiple watch directories using autotools, but so far this doesn't seem to be working. I am not sure what I am missing.

I have
Code:
# Default directory to save the downloaded torrents.
directory = /volume1/
# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=/volume1/Torrents/*.torrent
in my /root/.rtorrent.rc file

in the directory /Torrents/ I have subdirectories
/Torrents/downloads/Music/
/Torrents/downloads/Video/

These are matched with the directories
/volume1/downloads/Music
/volume1/downloads/video

in the autotorrent settings I have
Enable "AutoWatch" feature checked
and
Path to base watch directory:
/volume1/Torrents

however, when I add a .torrent file to any subdirectory, nothing happens. Only when I add the .torrent to the main directory (volume1/Torrents) does the torrent get loaded into the client.

Any ideas what i may be doing wrong?
 

simur612

Member
May 25, 2018
879
0
16
yes, watch doesnt' behave like autowatch

watch only works for the specific directory.
 

lisas4567

Member
May 25, 2018
773
0
16
by using the autotools plugin instead of .rtorrent.rc
I am using autotools. what exactly do i change so atuotools handles the watch folders and not rtorrent.rc? do I have to comment out the line in rtorrent.rc? I tried that, and then nothing worked. So how does autotools watch folder function work? where do I set the defaults?
 

simur612

Member
May 25, 2018
879
0
16
if you are using autotools and it's not working then you need to check a couple things:

1) do you have command line php enabled in your rutorrent config.php for the user

2) if so, do you have php command line enabled in your user, make sure you have "register_argc_argv" enabled for the php-cli.ini

3) if that fails, enable logging in both the plugin's conf.php and the rutorrent config.php and also check permissions
 

lisas4567

Member
May 25, 2018
773
0
16
if you are using autotools and it's not working then you need to check a couple things:

1) do you have command line php enabled in your rutorrent config.php for the user

2) if so, do you have php command line enabled in your user, make sure you have "register_argc_argv" enabled for the php-cli.ini

3) if that fails, enable logging in both the plugin's conf.php and the rutorrent config.php and also check permissions
no idea what any of that is. guess I'll just stick with regular watch folders.
 

simur612

Member
May 25, 2018
879
0
16
dont' give up so easy.


First, what os are you using?

secondly, where did you install rutorrent? and are you using some from of authentication.


third, what's the output of
Code:
php -v
 

lisas4567

Member
May 25, 2018
773
0
16
dont' give up so easy.


First, what os are you using?
rtorrent is installed on my new Synology DiskStation DS411j. I followed this guide to get it all set up, and everything is running smoothly now (so far as I can tell)
secondly, where did you install rutorrent? and are you using some from of authentication
according to the guide, the program is run from /opt/etc/init.d/S99rtorrent
third, what's the output of
Code:
php -v
PHP 5.2.17 (cli) (built: Jan 11 2011 22:42:18)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
 

simur612

Member
May 25, 2018
879
0
16
there is a big difference between rtorrent and rutorrent.


one is a client, one is a webui for that client =)

I can't speak on that guide or that os but if you didn't set the php command line binary path in your config.php for rutorrent, it could bne the issue
 

lisas4567

Member
May 25, 2018
773
0
16
there is a big difference between rtorrent and rutorrent.


one is a client, one is a webui for that client =)

I can't speak on that guide or that os but if you didn't set the php command line binary path in your config.php for rutorrent, it could bne the issue
yup, I get that. So how do I set the command line in the php?
currently my config.php looks like this:
Code:
// configuration parameters

// for snoopy client
@define('HTTP_USER_AGENT', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0', true);
@define('HTTP_TIME_OUT', 30, true); // in seconds
@define('HTTP_USE_GZIP', true, true);

@define('RPC_TIME_OUT', 5, true); // in seconds

@define('LOG_RPC_CALLS', false, true);
@define('LOG_RPC_FAULTS', true, true);

// for php
@define('PHP_USE_GZIP', false, true);
@define('PHP_GZIP_LEVEL', 2, true);

$do_diagnostic = true;
$log_file = '/tmp/errors.log'; // path to log file (comment or make empty to disable logging)
$saveUploadedTorrents = true;

$topDirectory = '/'; // Upper available directory. Absolute path with trail slash.
$forbidUserSettings = false;

$scgi_port = 5050;
$scgi_host = "127.0.0.1";

$XMLRPCMountPoint = "/RPC2"; // DO NOT DELETE THIS LINE!!! DO NOT COMMENT THIS LINE!!!

$pathToExternals = array(
"php" => '', // Something like /usr/bin/php. If empty, will be founded in PATH.
"curl" => '', // Something like /usr/bin/curl. If empty, will be founded in PATH.
"gzip" => '', // Something like /usr/bin/gzip. If empty, will be founded in PATH.
"id" => '', // Something like /usr/bin/id. If empty, will be founded in PATH.
"stat" => '', // Something like /usr/bin/stat. If empty, will be founded in PATH.
);

// For web->rtorrent link through unix domain socket
// (scgi_local in rtorrent conf file), change variables
// above to something like this:
//
// $scgi_port = 0;
// $scgi_host = "unix:///tmp/rpc.socket";

The only change was changing the $scgi_port to 5050, as per the guide. Is this the config file you are referring to? or is there another one?
 

lisas4567

Member
May 25, 2018
773
0
16
sorry, I misread your question a couple of posts back.
rutorrent is installed here:
/opt/share/www/rutorrent/
 

simur612

Member
May 25, 2018
879
0
16
ok, do this:

It looks like you found the main rutorrent conf file, it can be installed in 2 places, if you're only using a single user, it can just be in rutorrent/conf/config.php but it could also be in rutorrent/conf/users/USERNAME/config.php so double check that you aren't using that.


Once you have done that, if you look in the conf file for "$pathToExternals" you will see where php is listed. put the location of your php command line install there. on many systems it is at /usr/bin/php but i am not sure where it would be on yours. You can TRY the "which" command, if it's inside your "PATH" it will show up, so something like:



Code:
which php
 

lisas4567

Member
May 25, 2018
773
0
16
ok, do this:

It looks like you found the main rutorrent conf file, it can be installed in 2 places, if you're only using a single user, it can just be in rutorrent/conf/config.php but it could also be in rutorrent/conf/users/USERNAME/config.php so double check that you aren't using that.


Once you have done that, if you look in the conf file for "$pathToExternals" you will see where php is listed. put the location of your php command line install there. on many systems it is at /usr/bin/php but i am not sure where it would be on yours. You can TRY the "which" command, if it's inside your "PATH" it will show up, so something like:



Code:
which php
Before I continue, I just wanted to thank you for your assistance with this. I do Windows installs and build systems for people so I know how frustrating it can be sometimes to deal with people who have no clue what you are talking about. So thank you for putting up with this Linux noob smiley.gif

OK, I have no files in the users folder. I didn't expect to, but I wasn't sure if the Synology would create anything on it's own. Doesn't look like it, so I have just the one config file I posted earlier. The php command line is at /opt/bin/php (according to my own eyes as well as the "which php" command), so I have added that to the config:

Code:
$pathToExternals = array(
"php" => '/opt/bin/php', // Something like /usr/bin/php. If empty, will be founded in PATH.
did I do that correctly?
so what's the next step? restart rtorrent?