Fli
12-09-2013, 11:49 AM
How to install and use rtorrent on CentOS linux from command line?
install rtorrent:
yum install rtorrent
open rtorrent configuration file (/root/.rtorrent.rc):
vi /root/.rtorrent.rc
a) if is empty, paste following content and edit it according to your needs
b) if you see some contents, then you can edit it and paste some interesting lines from the following code (if needed)
# location where new torrent data is placed, and where you should place your
# 'complete' data before you place your *.torrent file into the watch folder
directory = /root/torrents
# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=~/torrents/watch/*.torrent
schedule = untied_directory,5,5,stop_untied=
# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=1024M
# Port range to use for listening.
port_range = 6890-6999
# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,try_outgoing,enable_retry
################################################## ############################
# schedule a timer event named 'watch_directory_1':
# 1) triggers 10 seconds after rtorrent starts
# 2) triggers at 10 second intervals thereafter
# 3) Upon trigger, attempt to load (and start) new *.torrent files found in /home/user/torrents/watch/
# 4) set a variable named 'custom1' with the value "/home/user/torrents/complete"
# NOTE: if you do not want it to automatically start the torrent, change 'load_start' to 'load'
schedule = watch_directory_1,10,10,"load_start=/home/user/torrents/watch/*.torrent,d.set_custom1=/home/user/torrents/complete"
# insert a method with the alias 'checkdirs1'
# 1) returns true if the current path of the torrent data is not equal to the value of custom1
# 2) otherwise, returns false
system.method.insert=checkdirs1,simple,"not=\"$equal={d.get_custom1=,d.get_base_path=}\""
# insert a method with the alias 'movecheck1'
# 1) returns true if all 3 commands return true ('result of checkdirs1' && 'torrent is 100% done', 'custom1 variable is set')
# 2) otherwise, returns false
system.method.insert=movecheck1,simple,"and={check dirs1=,d.get_complete=,d.get_custom1=}"
# insert a method with the alias 'movedir1'
# (a series of commands, separated by ';')
# 1) "set path of torrent to equal the value of custom1";
# 2) "mv -u <current data path> <custom1 path>";
# 3) "clear custom1", "stop the torrent","resume the torrent"
# 4) stop the torrent
# 5) start the torrent (to get the torrent to update the 'base path')
system.method.insert=movedir1,simple,"d.set_direct ory=$d.get_custom1=;execute=mv,-u,$d.get_base_path=,$d.get_custom1=;d.set_custom1= ;d.stop=;d.start="
# set a key with the name 'move_hashed1' that is triggered by the hash_done event.
# 1) When hashing of a torrent completes, this custom key will be triggered.
# 2) when triggered, execute the 'movecheck1' method and check the return value.
# 3) if the 'movecheck' method returns 'true', execute the 'movedir1' method we inserted above.
# NOTE-0: *Only* data that has had their hash checked manually with ^R [^R = Control r].
# Or on a rtorrent restart[which initiates a hash check]. Will the data move; ~/torrents/incomplete => ~/torrents/complete for example.
# NOTE-1: 'branch' is an 'if' conditional statement: if(movecheck1){movedir1}
system.method.set_key = event.download.inserted_session,tracker,"d.set_custom2=\"$execute_capture={script.sh,$d.get_tied_to_file=}\""
To start inserting/doing changes, type "a". When done editing, do Ctrl+C command and then type :wq and Enter to save changes and or to quit editor without saving changes in file, type and execute :q!
(make sure / or /root has enough disk space to store your torrents (/root/torrents) by doing command: df -h ; else update config. file above and create directories below on different partition/drive)
In configuration file above we set our download directory to: /root/torrents and torrent files watch directory to: /root/torrents/watch so lets create these directories by command:
mkdir -p /root/torrents/watch
So all torrent files lets download/move to that watch directory. To download some .torrent file to this directory, get there (cd /root/torrents/watch) then do (wget http://domain.com/folder/torrentfilename.torrent) or Dl with redirect: (curl -O -J -L https://bt-scene.cc/torrentdownload.php?id=1234) you can also wget (download) .zip file same way and then unzip it by (unzip filename.zip).
To download via Magnet link, you can try to hit backspace key and paste the magnet link (example: magnet:?xt=urn:btih:b00860241c75be755ceebd43d920ce 065e32e199&dn=Magnetizer) and hit enter. If you do not enter any trackers in the magnet URL, then it may not work on old CentOS 6 as DHT Requires (https://github.com/rakshasa/rtorrent/wiki/Using-DHT) libTorrent/rTorrent version 0.12.0/0.8.0 or higher and centos old repository may have lower version. Other option beside magnet or magnet with trackers is to google torrent's hash (from magnet URL) and find torrent file which one download into rtorrent watch folder (wget url -O /root/torrents/watch/):
example one can also try to use torrent caches to DL torrent knowing its hash:
wget http://itorrents.org/torrent/876CD7E0B8EBA9B91D1646DD531132CCB8494740.torrent
wget http://torrage.info/torrent.php?h=876CD7E0B8EBA9B91D1646DD531132CCB849 4740
wget http://btcache.me/torrent/876CD7E0B8EBA9B91D1646DD531132CCB8494740
wget http://torrasave.download/torrent/876CD7E0B8EBA9B91D1646DD531132CCB8494740.torrent
wget http://thetorrent.org/876CD7E0B8EBA9B91D1646DD531132CCB8494740.torrent
wget http://thetorrent.to/876CD7E0B8EBA9B91D1646DD531132CCB8494740.torrent
(make sure you are inside watch folder - cd /root/torrents/watch)
After you have torrent files in the watch directory (ls -l), you can start rtorrent by command:
rtorrent
Now lets open all torrent files we have in watch folder by hitting Enter key in rtorrent interface and typing * and executing by enter, this will load all files in the our watch directory into rtorrent
rtorrent basic commands:
- Backspace - add torrent from URL
- Ctrl+s start torrent
- Ctrl+d stop selected torrent , hit twice to delete torrent
- Ctrl+k close torrent (so its inactive)
- Ctrl+o change output directory
- arrow keys to navigate between torrents, right key to get into detail of the torrent
- Ctrl+q quit rtorrent
----------------------------
ISSUES
ISSUE: rtorrent: symbol lookup error: rtorrent: undefined symbol: _ZN7torrent10ThreadBase8m_globalE
SOLUTION: Try this command and run rtorrent again: yum downgrade libtorrent
ISSUE: rtorrent: Error in option file: ~/.rtorrent.rc:61: Junk at end of input.
SOLUTION: comment out (add # before it) mentioned line (61) out of .rtorrent.rc file
ISSUE: torrent dont downloading?
SOLUTION: Try to use some public torrents like google: intext:.torrent linux iso to ensure problem is not in torrent file. if you running any firewall, try to disable it temporarilly to see if its the issue. Ensure you have port range 6890-6999 (you set in your .rtorrent.rc config file) allowed/open in your firewall. Example, i had Config Server Firewall, so i tried to add it to the allowed ports in "vi /etc/csf/csf.conf" like: someport,someport2,6890:6999,someport4,someport5 then saved CSF config file and restarted csf by command (csf -r).
Making rtorrent run on background:
it can be done with command "screen (http://internetlifeforum.com/linux-forums/1214-linux-command-screen-keep-commands-running%3B-work-separate-window/)"
You have another issues with rtorrent?
install rtorrent:
yum install rtorrent
open rtorrent configuration file (/root/.rtorrent.rc):
vi /root/.rtorrent.rc
a) if is empty, paste following content and edit it according to your needs
b) if you see some contents, then you can edit it and paste some interesting lines from the following code (if needed)
# location where new torrent data is placed, and where you should place your
# 'complete' data before you place your *.torrent file into the watch folder
directory = /root/torrents
# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=~/torrents/watch/*.torrent
schedule = untied_directory,5,5,stop_untied=
# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=1024M
# Port range to use for listening.
port_range = 6890-6999
# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,try_outgoing,enable_retry
################################################## ############################
# schedule a timer event named 'watch_directory_1':
# 1) triggers 10 seconds after rtorrent starts
# 2) triggers at 10 second intervals thereafter
# 3) Upon trigger, attempt to load (and start) new *.torrent files found in /home/user/torrents/watch/
# 4) set a variable named 'custom1' with the value "/home/user/torrents/complete"
# NOTE: if you do not want it to automatically start the torrent, change 'load_start' to 'load'
schedule = watch_directory_1,10,10,"load_start=/home/user/torrents/watch/*.torrent,d.set_custom1=/home/user/torrents/complete"
# insert a method with the alias 'checkdirs1'
# 1) returns true if the current path of the torrent data is not equal to the value of custom1
# 2) otherwise, returns false
system.method.insert=checkdirs1,simple,"not=\"$equal={d.get_custom1=,d.get_base_path=}\""
# insert a method with the alias 'movecheck1'
# 1) returns true if all 3 commands return true ('result of checkdirs1' && 'torrent is 100% done', 'custom1 variable is set')
# 2) otherwise, returns false
system.method.insert=movecheck1,simple,"and={check dirs1=,d.get_complete=,d.get_custom1=}"
# insert a method with the alias 'movedir1'
# (a series of commands, separated by ';')
# 1) "set path of torrent to equal the value of custom1";
# 2) "mv -u <current data path> <custom1 path>";
# 3) "clear custom1", "stop the torrent","resume the torrent"
# 4) stop the torrent
# 5) start the torrent (to get the torrent to update the 'base path')
system.method.insert=movedir1,simple,"d.set_direct ory=$d.get_custom1=;execute=mv,-u,$d.get_base_path=,$d.get_custom1=;d.set_custom1= ;d.stop=;d.start="
# set a key with the name 'move_hashed1' that is triggered by the hash_done event.
# 1) When hashing of a torrent completes, this custom key will be triggered.
# 2) when triggered, execute the 'movecheck1' method and check the return value.
# 3) if the 'movecheck' method returns 'true', execute the 'movedir1' method we inserted above.
# NOTE-0: *Only* data that has had their hash checked manually with ^R [^R = Control r].
# Or on a rtorrent restart[which initiates a hash check]. Will the data move; ~/torrents/incomplete => ~/torrents/complete for example.
# NOTE-1: 'branch' is an 'if' conditional statement: if(movecheck1){movedir1}
system.method.set_key = event.download.inserted_session,tracker,"d.set_custom2=\"$execute_capture={script.sh,$d.get_tied_to_file=}\""
To start inserting/doing changes, type "a". When done editing, do Ctrl+C command and then type :wq and Enter to save changes and or to quit editor without saving changes in file, type and execute :q!
(make sure / or /root has enough disk space to store your torrents (/root/torrents) by doing command: df -h ; else update config. file above and create directories below on different partition/drive)
In configuration file above we set our download directory to: /root/torrents and torrent files watch directory to: /root/torrents/watch so lets create these directories by command:
mkdir -p /root/torrents/watch
So all torrent files lets download/move to that watch directory. To download some .torrent file to this directory, get there (cd /root/torrents/watch) then do (wget http://domain.com/folder/torrentfilename.torrent) or Dl with redirect: (curl -O -J -L https://bt-scene.cc/torrentdownload.php?id=1234) you can also wget (download) .zip file same way and then unzip it by (unzip filename.zip).
To download via Magnet link, you can try to hit backspace key and paste the magnet link (example: magnet:?xt=urn:btih:b00860241c75be755ceebd43d920ce 065e32e199&dn=Magnetizer) and hit enter. If you do not enter any trackers in the magnet URL, then it may not work on old CentOS 6 as DHT Requires (https://github.com/rakshasa/rtorrent/wiki/Using-DHT) libTorrent/rTorrent version 0.12.0/0.8.0 or higher and centos old repository may have lower version. Other option beside magnet or magnet with trackers is to google torrent's hash (from magnet URL) and find torrent file which one download into rtorrent watch folder (wget url -O /root/torrents/watch/):
example one can also try to use torrent caches to DL torrent knowing its hash:
wget http://itorrents.org/torrent/876CD7E0B8EBA9B91D1646DD531132CCB8494740.torrent
wget http://torrage.info/torrent.php?h=876CD7E0B8EBA9B91D1646DD531132CCB849 4740
wget http://btcache.me/torrent/876CD7E0B8EBA9B91D1646DD531132CCB8494740
wget http://torrasave.download/torrent/876CD7E0B8EBA9B91D1646DD531132CCB8494740.torrent
wget http://thetorrent.org/876CD7E0B8EBA9B91D1646DD531132CCB8494740.torrent
wget http://thetorrent.to/876CD7E0B8EBA9B91D1646DD531132CCB8494740.torrent
(make sure you are inside watch folder - cd /root/torrents/watch)
After you have torrent files in the watch directory (ls -l), you can start rtorrent by command:
rtorrent
Now lets open all torrent files we have in watch folder by hitting Enter key in rtorrent interface and typing * and executing by enter, this will load all files in the our watch directory into rtorrent
rtorrent basic commands:
- Backspace - add torrent from URL
- Ctrl+s start torrent
- Ctrl+d stop selected torrent , hit twice to delete torrent
- Ctrl+k close torrent (so its inactive)
- Ctrl+o change output directory
- arrow keys to navigate between torrents, right key to get into detail of the torrent
- Ctrl+q quit rtorrent
----------------------------
ISSUES
ISSUE: rtorrent: symbol lookup error: rtorrent: undefined symbol: _ZN7torrent10ThreadBase8m_globalE
SOLUTION: Try this command and run rtorrent again: yum downgrade libtorrent
ISSUE: rtorrent: Error in option file: ~/.rtorrent.rc:61: Junk at end of input.
SOLUTION: comment out (add # before it) mentioned line (61) out of .rtorrent.rc file
ISSUE: torrent dont downloading?
SOLUTION: Try to use some public torrents like google: intext:.torrent linux iso to ensure problem is not in torrent file. if you running any firewall, try to disable it temporarilly to see if its the issue. Ensure you have port range 6890-6999 (you set in your .rtorrent.rc config file) allowed/open in your firewall. Example, i had Config Server Firewall, so i tried to add it to the allowed ports in "vi /etc/csf/csf.conf" like: someport,someport2,6890:6999,someport4,someport5 then saved CSF config file and restarted csf by command (csf -r).
Making rtorrent run on background:
it can be done with command "screen (http://internetlifeforum.com/linux-forums/1214-linux-command-screen-keep-commands-running%3B-work-separate-window/)"
You have another issues with rtorrent?