Skip to content

Instantly share code, notes, and snippets.

@abdiasriver
Last active October 18, 2021 15:08
Show Gist options
  • Save abdiasriver/76eadc4ab275ea65a19cddf317cccf4c to your computer and use it in GitHub Desktop.
Save abdiasriver/76eadc4ab275ea65a19cddf317cccf4c to your computer and use it in GitHub Desktop.
Instalacion de transmission en ubuntu server
#TRANSMISSION SERVER EN UBUNTU MINIMAL
sudo apt update
sudo apt install transmission-cli transmission-common transmission-daemon
sudo service transmission-daemon stop
#CAMBIAR IP a *.*.*.* ,USUARIO,PASSWORD
sudo apt install nano
sudo nano /var/lib/transmission-daemon/info/settings.json
#### CONfiguracion recomendada /var/lib/transmission-daemon/info/settings.json
#"download-queue-size": 1, #limite de descargas activas
#"download-dir": "/home/usuario/Tcomplete", #carpeta donde se estaran descargando los archivos
#"rpc-password": "{cd9a5ba2c3e5dd9e808c670e8eec6d72d24c47d8gRNnsWCJ", #contrase;a en el servidor
#"rpc-username": "usuario", #usuario en el servidor
#"rpc-whitelist": "*.*.*.*", #ip del servidor o *.*.*.* para ceptar todos
# "script-torrent-done-enabled": true, #activaremos el script para mover y eliminar los a.torrent finalizados
# "script-torrent-done-filename": "/var/lib/scripts/completed.sh", #script que se ejecuta al finalizar un torrent
#umask 18 a umask 2
#==================================================
{
"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"blocklist-url": "http://www.example.com/blocklist",
"cache-size-mb": 4,
"dht-enabled": true,
"download-dir": "/home/usuario/Tcomplete",
"download-limit": 100,
"download-limit-enabled": 0,
"download-queue-enabled": true,
"download-queue-size": 1,
"encryption": 1,
"idle-seeding-limit": 30,
"idle-seeding-limit-enabled": false,
"incomplete-dir": "/home/usuario/Tincomplete",
"incomplete-dir-enabled": true,
"lpd-enabled": false,
"max-peers-global": 200,
"message-level": 1,
"peer-congestion-algorithm": "",
"peer-id-ttl-hours": 6,
"peer-limit-global": 200,
"peer-limit-per-torrent": 50,
"peer-port": 51413,
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": false,
"peer-socket-tos": "default",
"pex-enabled": true,
"pidfile": "/var/lib/transmission-daemon/.config/transmission-daemon/trans.PID",
"port-forwarding-enabled": false,
"preallocation": 1,
"prefetch-enabled": true,
"queue-stalled-enabled": true,
"queue-stalled-minutes": 30,
"ratio-limit": 0,
"ratio-limit-enabled": true,
"rename-partial-files": true,
"rpc-authentication-required": true,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-host-whitelist": "",
"rpc-host-whitelist-enabled": true,
"rpc-password": "contraseña",
"rpc-port": 9091,
"rpc-url": "/transmission/",
"rpc-username": "usuario",
"rpc-whitelist": "*.*.*.*",
"rpc-whitelist-enabled": true,
"scrape-paused-torrents-enabled": true,
"script-torrent-done-enabled": true,
"script-torrent-done-filename": "/var/lib/scripts/autoremove.sh",
"seed-queue-enabled": false,
"seed-queue-size": 10,
"speed-limit-down": 100,
"speed-limit-down-enabled": false,
"speed-limit-up": 0,
"speed-limit-up-enabled": true,
"start-added-torrents": true,
"trash-original-torrent-files": false,
"umask": 2,
"upload-limit": 100,
"upload-limit-enabled": 0,
"upload-slots-per-torrent": 14,
"utp-enabled": true
}
#==================================================
sudo nano /etc/init.d/transmission-daemon
# cambiar las variables USER debian-transmission a usuario
USER=debian-transmission
USER=usuario
#Modificar el archivo
sudo nano /etc/systemd/system/multi-user.target.wants/transmission-daemon.service
#cambiar todo por:
#===========================================
[Unit]
Description=Transmission BitTorrent Daemon
After=network.target
[Service]
User=usuario
Type=forking
PIDFile=/var/lib/transmission-daemon/.config/transmission-daemon/trans.PID
ExecStart=/usr/bin/transmission-daemon --pid-file /var/lib/transmission-daemon/.config/transmission-daemon/trans.PID --config-dir /var/lib/transmission-daemon/.config/transmission-daemon
[Install]
WantedBy=multi-user.target
#=========================
sudo touch /var/lib/transmission-daemon/.config/transmission-daemon/trans.PID
sudo chown usuario.usuario /var/lib/transmission-daemon/.config/transmission-daemon/trans.PID
sudo chown -R usuario.usuario /etc/transmission-daemon/
sudo chown -R usuario.usuario /var/lib/transmission-daemon/
mkdir /home/usuario/Tcomplete
mkdir /home/usuario/Tincomplete
sudo chown -R usuario.usuario /home/usuario/Tincomplete/
sudo chown -R usuario.usuario /home/usuario/Tcomplete/
sudo mkdir /var/lib/scripts
sudo nano /var/lib/scripts/autoremove.sh
#pegar dentro esto
#================================================INICIO autoremove.sh
#!/bin/sh
transmission-remote --auth=usuario:contraseña -l | grep 100\% | grep Done | awk '{print $1}' | xargs -n 1 -I \% /usr/bin/transmission-remote --auth=usuario:contraseña -t \% -r
#========================================================FIN autoremove.sh
sudo chmod +x /var/lib/scripts/autoremove.sh
#cambiar debian-transmission por mi usuario si ya existe el archivo
#sudo nano /lib/systemd/system/transmission-daemon.service
#Si te da un error asi
#[2017-02-15 17:16:26.426 CET] UDP Failed to set receive buffer: requested 4194304, got 327680 (tr-udp.c:78)
#[2017-02-15 17:16:26.426 CET] UDP Failed to set send buffer: requested 1048576, got 327680 (tr-udp.c:89)
#Haz lo siguiente]
sudo nano /etc/sysctl.conf
#agrega esto
net.core.rmem_max = 16777216
net.core.wmem_max = 4194304
#Despues ejecutalo
sudo sysctl -p
sudo systemctl daemon-reload
sudo service transmission-daemon start
sudo service transmission-daemon status
#===================================================
#Si vuelves a EDITAR algo
sudo service transmission-daemon stop
sudo nano /var/lib/transmission-daemon/info/settings.json
sudo systemctl daemon-reload
sudo service transmission-daemon start
sudo service transmission-daemon status
#en la gui del servidor se cambio
#Error 409 checar que termine en /
#http://34.125.149.207:9091/transmission/web/
#Los .torrent se guardan en a carpeta /var/lib/transmission-daemon/info/torrents
# hacer un bakup ya que se elimininaran de la carpeta original y con rsync agregado al script de la conf torrent se copian antes
mkdir torrentsbk
sudo apt install rsync
rsync /var/lib/transmission-daemon/info/torrents/* /home/usuario/torrentsbk/
# Montar unidad Team Drive y sustituir la caprpeta en el script completed.sh por la ubicacion montada de la unidad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment