Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save abdiasriver/626839ac48ef1b357c26f81db60e5269 to your computer and use it in GitHub Desktop.
Save abdiasriver/626839ac48ef1b357c26f81db60e5269 to your computer and use it in GitHub Desktop.
Mover las descargas de transmission a un Drive o carpeta y eliminar los .torrent de la gui del server
#!/bin/sh
# EN la interfaz web de transmission ve a torrentas>stop sedding at raio: 0 ,config>speed> upload Kb/s=0
MOVEDIR=/home/abdias/plexcloud #Carpeta destino donde se movera el torrent
TORRENTLIST=`transmission-remote --auth=abdias:abdias --list | sed -e '1d;$d;s/^ *//' | cut --only-delimited --delimiter=' ' --fields=1`
for TORRENTID in $TORRENTLIST
do
echo "* * * * * Se inicia operacion en el ID $TORRENTID del torrent. * * * * *"
DL_COMPLETED=`transmission-remote --auth=abdias:abdias --torrent $TORRENTID --info | grep "Percent Done: 100%"`
STATE_STOPPED=`transmission-remote --auth=abdias:abdias --torrent $TORRENTID --info | grep "State: Stopped\|Finished\|Idle"`
if [ "$DL_COMPLETED" != "" ] && [ "$STATE_STOPPED" != "" ]; then
echo "Torrent #$TORRENTID esta completado."
echo "Moviendo archivo(s) a $MOVEDIR."
transmission-remote --auth=abdias:abdias --torrent $TORRENTID --move $MOVEDIR
echo "Eliminando torrent ."
transmission-remote --auth=abdias:abdias --torrent $TORRENTID --remove
else
echo "El Torrent #$TORRENTID no esta completo, ignorando."
fi
echo "* * * * * Operaciones en el ID $TORRENTID completadas. * * * * *"
done
#tener la configuracion siguiente en sudo nano /var/lib/transmission-daemon/info/settings.json
#"script-torrent-done-enabled": true,
#"script-torrent-done-filename": "/var/lib/scripts/posttorrent.sh",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment