Difference between revisions of "Transmission"

From Indie IT Wiki
imported>Plittlefield
 
 
(2 intermediate revisions by the same user not shown)
Line 184: Line 184:
 
   1    95%    670.3 MB  Unknown      0.0    0.0  0.08  Stopped      Name Of Torrent
 
   1    95%    670.3 MB  Unknown      0.0    0.0  0.08  Stopped      Name Of Torrent
 
   Sum:          670.3 MB              0.0    0.0
 
   Sum:          670.3 MB              0.0    0.0
 +
 +
On some servers (seedbox) you have to use the protocol and add an '''extra directory path''' after the port number ...
 +
 +
transmission-remote <nowiki>https://transmission.myserver.co.uk:443</nowiki>'''/transmission/rpc''' --auth username:password --list
  
 
=== Schedule Start & Stop Of Torrents ===
 
=== Schedule Start & Stop Of Torrents ===
  
  crontab -e
+
This is for a seedbox ...
 +
 
 +
  05 0 * * * transmission-remote <nowiki>https://transmission.domain.co:443/transmission/rpc</nowiki> --auth username:mYpAsSwOrD --torrent all --start &>/dev/null
 +
55 5 * * * transmission-remote <nowiki>https://transmission.domain.co:443/transmission/rpc</nowiki> --auth username:mYpAsSwOrD --torrent all --stop &>/dev/null
 +
 
 +
This is for a local server ...
 
   
 
   
# minute hour dayofmonth month dayofweek command
 
 
  01 00 * * * transmission-remote 192.168.0.4:9091 --auth us3rn4m3:p4ssw0rd --torrent all --start
 
  01 00 * * * transmission-remote 192.168.0.4:9091 --auth us3rn4m3:p4ssw0rd --torrent all --start
 
  59 07 * * * transmission-remote 192.168.0.4:9091 --auth us3rn4m3:p4ssw0rd --torrent all --stop
 
  59 07 * * * transmission-remote 192.168.0.4:9091 --auth us3rn4m3:p4ssw0rd --torrent all --stop

Latest revision as of 10:51, 18 May 2023

MAJOR GOALPOST MOVING

March 2017

The latest version of transmission 2.92 for Ubuntu would not start, then would not allow me to access the web gui.

(sigh)

So, to fix, you need to change permssions of folders back to how you want them, edit the new systemd config file for a hack so that it loads the correct configuration and hack the start file so that it allows you access.

(sigh)

sudo -i
chown -R paully:debian-transmission /etc/transmission-daemon/
chown -R paully:debian-transmission /var/lib/transmission-daemon/

nano /lib/systemd/system/transmission-daemon.service
  User=paully
  Type=notify
  ExecStart=/usr/bin/transmission-daemon --allowed "127.0.0.1,192.168.0.*" -f --log-info --config-dir=/var/lib/transmission-daemon/info

systemctl daemon-reload 
service transmission-daemon start

HOWTO: INSTALLATION & CONFIGURATION:

From Repository

sudo add-apt-repository ppa:transmissionbt/ppa
sudo apt-get update
sudo apt-get install transmission-cli transmission-common transmission-daemon

Set Up Transmission Daemon Headless In Ubuntu Server

This will create a passwordless set up with files freely accessible, perfect for a NAS in your private home network. The service must be stopped before editing the file otherwise any changes will be overwritten.

sudo apt-get install transmission-daemon

sudo service transmission-daemon stop

sudo cp -av /var/lib/transmission-daemon/info/settings.json /var/lib/transmission-daemon/info/settings.default

sudo nano /var/lib/transmission-daemon/info/settings.json
   "download-dir": "/path/to/Downloads/transmission/", 
   "pidfile": "/var/lib/transmission-daemon/.config/transmission-daemon/trans.PID", 
   "rpc-authentication-required": false, 
   "rpc-bind-address": "0.0.0.0", 
   "rpc-enabled": true, 
   "rpc-password": "", 
   "rpc-port": 9091, 
   "rpc-url": "/transmission/", 
   "rpc-username": "", 
   "rpc-whitelist": "127.0.0.1,192.168.0.*", 
   "rpc-whitelist-enabled": false, 
   "umask": 2, 
   "watch-dir": "/home/user/Downloads/",
   "watch-dir-enabled": true

Save and exit.

sudo mkdir -p /var/lib/transmission-daemon/.config/transmission-daemon

sudo touch /var/lib/transmission-daemon/.config/transmission-daemon/trans.PID

sudo chown -R nobody:nogroup /var/lib/transmission-daemon

sudo chmod -R g+w /var/lib/transmission-daemon

sudo chown -R nobody:nogroup /etc/transmission-daemon

sudo chmod -R g+w /etc/transmission-daemon

sudo mkdir /path/to/Downloads/transmission

sudo chown -R nobody:nogroup /path/to/Downloads/transmission

sudo chmod -R g+w /path/to/Downloads/transmission

sudo nano /etc/init.d/transmission-daemon
   USER=nobody

sudo nano -$ /lib/systemd/system/transmission-daemon.service
   [Unit]
   Description=Transmission BitTorrent Daemon
   After=network.target
   [Service]
   User=nobody
   Type=notify
   PIDFile=/var/lib/transmission-daemon/.config/transmission-daemon/trans.PID
   ExecStart=/usr/bin/transmission-daemon -f --log-error --pid-file /var/lib/transmission-daemon/.config/transmission-daemon/trans.PID --config-dir /var/lib/transmission-daemon/.config/transmission-daemon/
   ExecReload=/bin/kill -s HUP $MAINPID
   [Install]
   WantedBy=multi-user.target

sudo systemctl daemon-reload

sudo nano /etc/sysctl.conf
   # Transmission Tweaks
   net.core.rmem_max = 4194304
   net.core.wmem_max = 1048576
   net.ipv4.neigh.default.retrans_time_ms = 250

sudo sysctl -p

sudo service transmission-daemon restart

To access the server, point your web browser to http://your.server.ip.address:9091

Thanks to OSMC.

HOWTO: ACCESS:

Web Interface

http://192.168.0.4:9091/transmission/web/

Where 192.168.0.4 is your computers IP address.

Or you can use:

http://localhost:9091/transmission/web/

Migration From Another Server

If you want to copy the torrent files and database from another server...

sudo cp -av /mnt/wd_old/var/lib/transmission-daemon/info/* /var/lib/transmission-daemon/info/
sudo chgrp -R debian-transmission /var/lib/transmission-daemon/*

ll /var/lib/transmission-daemon/info/
drwxrwxr-x 2 paully debian-transmission 4.0K 2012-07-27 21:32 blocklists
-rw------- 1 paully debian-transmission  574 2017-01-12 11:14 dht.dat
drwxrwxr-x 2 paully debian-transmission 4.0K 2017-01-12 14:42 resume
lrwxrwxrwx 1 paully debian-transmission   38 2016-04-21 21:37 settings.default -> /etc/transmission-daemon/settings.json
lrwxrwxrwx 1 paully debian-transmission   38 2016-03-07 20:11 settings.json -> /etc/transmission-daemon/settings.json
-rw------- 1 paully debian-transmission  164 2017-01-12 11:14 stats.json
drwxrwxr-x 2 paully debian-transmission 4.0K 2017-01-12 09:00 torrents

sudo service transmission-daemon start
sudo systemctl status transmission-daemon.service


Remove Trackers

List all torrents to find their ID number...

transmission-remote 127.0.0.1:9091 --auth username:password --list

For a particular torrent, find out what trackers are not connecting and have no useful seeders...

transmission-remote 127.0.0.1:9091 --auth username:password --torrent 15 -it

Then remove each tracker one at a time...

transmission-remote 127.0.0.1:9091 --auth username:password --torrent 15 -tr 0

Then check the tracker list for that torrent again...

transmission-remote 127.0.0.1:9091 --auth username:password --torrent 15 -it

Repeat as necessary, until you are left with the good tracker listed as Tier 1 at the top.

Add A Magnet Link In Firefox

https://trac.transmissionbt.com/wiki/MagnetLinks

Create A Torrent File (Command Line)

Create the file, using 2 public trackers...

transmission-create -t udp://tracker.publicbt.com:80/announce -t udp://tracker.openbittorrent.com:80/announce ~/path/to/file.mp4

Then add the newly created .torrent file to your Transmission Daemon...

transmission-remote 127.0.0.1:9091 --auth username:password --add ~/path/to/file.mp4.torrent

HOWTO: COMMAND LINE:

List Torrents

transmission-remote 192.168.0.4:9091 --auth us3rn4m3:p4ssw0rd --list

 ID     Done       Have  ETA           Up    Down  Ratio  Status       Name
  1    95%     670.3 MB  Unknown      0.0     0.0   0.08  Stopped      Name Of Torrent
 Sum:          670.3 MB               0.0     0.0

On some servers (seedbox) you have to use the protocol and add an extra directory path after the port number ...

transmission-remote https://transmission.myserver.co.uk:443/transmission/rpc --auth username:password --list

Schedule Start & Stop Of Torrents

This is for a seedbox ...

05 0 * * * transmission-remote https://transmission.domain.co:443/transmission/rpc --auth username:mYpAsSwOrD --torrent all --start &>/dev/null
55 5 * * * transmission-remote https://transmission.domain.co:443/transmission/rpc --auth username:mYpAsSwOrD --torrent all --stop &>/dev/null

This is for a local server ...

01 00 * * * transmission-remote 192.168.0.4:9091 --auth us3rn4m3:p4ssw0rd --torrent all --start
59 07 * * * transmission-remote 192.168.0.4:9091 --auth us3rn4m3:p4ssw0rd --torrent all --stop

Stop Shoreline Firewall (Shorewall) From Logging

Add the following lines to your /etc/shorewall/rules...

# Drop and do not log Transmission UDP Port 51413 packets
DROP:none!   net   fw   udp   51413

...and restart.

Set Up Transmission Daemon Headless In Ubuntu Server

This will create a passwordless set up with files freely accessible, perfect for a NAS in your private home network.

sudo apt-get install transmission-daemon
sudo service transmission-daemon stop
sudo nano /var/lib/transmission-daemon/info/settings.json
   "download-dir": "/path/to/Downloads/transmission/", 
   "pidfile": "/var/lib/transmission-daemon/.config/transmission-daemon/trans.PID", 
   "rpc-authentication-required": false, 
   "rpc-bind-address": "0.0.0.0", 
   "rpc-enabled": true, 
   "rpc-password": "", 
   "rpc-port": 9091, 
   "rpc-url": "/transmission/", 
   "rpc-username": "", 
   "rpc-whitelist": "127.0.0.1", 
   "rpc-whitelist-enabled": false, 
   "umask": 2, 
   "watch-dir": "/home/user/Downloads/", 
   "watch-dir-enabled": true
sudo touch /var/lib/transmission-daemon/.config/transmission-daemon/trans.PID
sudo chown -R nobody:nogroup /var/lib/transmission-daemon
sudo chmod -R g+w /var/lib/transmission-daemon
sudo chown -R nobody:nogroup /etc/transmission
sudo chmod -R g+w /etc/transmission-daemon
sudo mkdir /path/to/Downloads/transmission
sudo chown -R nobody:nogroup /path/to/Downloads/transmission
sudo chmod -R g+w /path/to/Downloads/transmission
sudo nano /etc/init.d/transmission-daemon
   user=nobody
sudo nano -$ /lib/systemd/system/transmission-daemon.service
   [Unit]
   Description=Transmission BitTorrent Daemon
   After=network.target
   [Service]
   User=nobody
   Type=notify
   PIDFile=/var/lib/transmission-daemon/.config/transmission-daemon/trans.PID
   ExecStart=/usr/bin/transmission-daemon -f --log-error --pid-file /var/lib/transmission-daemon/.config/transmission-daemon/trans.PID --config-dir /var/lib/transmission-daemon/.config/transmission-daemon/
   ExecReload=/bin/kill -s HUP $MAINPID
   [Install]
   WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo nano /etc/sysctl.conf
   net.core.rmem_max = 4194304
   net.core.wmem_max = 1048576
   net.ipv4.neigh.default.retrans_time_ms = 250
sudo sysctl -p
sudo service transmission-daemon restart

To access the server, point your web browser to http://your.server.ip.address:9091

Thanks - https://discourse.osmc.tv/t/solved-problem-setting-up-transmission/2803/7

External Links

http://www.transmissionbt.com