bash Bash Shell Script
Download Transmission BitTorrent - Completion ScriptDownload Transmission BitTorrent - Completion Script
Download Count: 91
Date Added: Sunday, 03-Jul-11 23:10:44 CDT
Tags: Transmission, shell script, public torrent, private torrent, Bit Torrent

For use with Transmission Bit Torrent Client (linux). Shell script to be called when torrent download completes. Determines if torrent tracker is public or private. Currently set to stop seeding if tracker is public.

Logs all completed torrents including completion time.

Could easily be modified to check for any other data. See my other script, Get Torrent Info, that shows most information available on a particular torrent.

Make sure the file is executable (chmod 755 public_torrent.sh), and preferably owned by the transmission client, on Ubuntu it is 'debian-transmission' (chown debian-transmission:debian-transmission public_torrent.sh).

File Name: public_torrent.sh - Code Type: Bash
#!/bin/bash
{
log=/var/lib/transmission-daemon/info/torrents.downloaded
 
USER=
PASSWD=
 
public=$(transmission-remote -n $USER:$PASSWD -t $TR_TORRENT_ID -i\
                    | grep "Public torrent:"\
                    | cut -d: -f2-\
                    | sed 's/^ *//')
      
echo "                 " >> $log
echo "======-----------------======" >> $log
echo "Download of  no: $TR_TORRENT_ID - $TR_TORRENT_NAME completed on $TR_TIME_LOCALTIME " >> $log
if [ $public = No ]; then
         echo -e "\t *** Seeding Non-Public Torrent ***" >> $log
          echo -e "\t *** Public Torrent = $public ***" >> $log
else
         echo -e "\t *** Removed Public Torrent ***" >> $log
          echo -e "\t *** Public Torrent = $public ***" >> $log  
         
          if ( transmission-remote -t$TR_TORRENT_ID --remove ); then
                echo "success" >> $log
          else
                echo "failure" >> $log
          fi
fi
echo "======-----------------======" >> $log
}&
Parsed in 0.058 seconds - Rate: 15.77 KB/s - GeSHi version: 1.0.8.10

Hope you find this helpful! If you have any questions, please leave a comment.


  • PHP
  • Scripts
  • MS
  • Office
  • Templates
  • and
  • Files
  • Assorted
  • Linux
  • Bash
  • Scripts
  • Perl
  • Scripts
  • PDF
  • FIles
  • MS
  • Excel
  • 2003
  • Template
  • employment
  • tools
  • job
  • search
  • tools
  • spreadsheet
  • Job
  • Search
  • Spreadsheet
  • Template
  • bash
  • shell
  • script
  • file
  • backup
  • linux
  • gzip
  • tar
  • File
  • Backup
  • Script
  • Transmission
  • shell
  • script
  • public
  • torrent
  • private
  • torrent
  • Bit
  • Torrent
  • Transmission
  • BitTorrent
  • Completion
  • Script
  • Transmission
  • shell
  • script
  • torrent
  • information
  • Bit
  • Torrent
  • Transmission
  • Bit
  • Torrent
  • Get
  • Torrent
  • Info
  • bash
  • shell
  • script
  • add
  • user
  • samba
  • samba
  • user
  • add
  • samba
  • user
  • linux
  • command
  • line
  • Add
  • System
  • and
  • Samba
  • User
  • geshi
  • pyrocms
  • php
  • codeigniter
  • PyroCMS/CodeIgniter
  • Geshi
  • Helper
  • File
  • geshi
  • pyrocms
  • php
  • codeigniter
  • GeSHi
  • Code
  • Highlighter
  • plugin
  • for
  • PyroCMS
  • perl
  • cgi
  • hit
  • counter
  • Simple
  • Perl
  • Hit
  • Counter
  • pyrocms
  • codeigniter
  • php
  • ip
  • address
  • session
  • userdata
  • PyroCMS
  • IP
  • Address
  • Plugin
  • Soyo
  • SY5SSM
  • Socket
  • 7
  • Motherboard
  • Quick
  • Start
  • Guide
  • Soyo
  • SY5SSM
  • Socket
  • 7
  • Motherboard
  • Quick
  • Start
  • Guide
  • Home
  • web
  • designit
  • supportlinuxphpbash
  • PRIVACY
  • Statement
  • LEGAL
  • Disclaimer
  • Ebay
  • Listings
  • Soyo
  • Motherboard
  • PDF
  • Why
  • I
  • Like
  • the
  • HoneyPi
  • Brand
  • IR
  • Receiver
  • Module
  • for
  • the
  • Raspberry
  • Pi
  • Using
  • GeSHi
  • Highlighter
  • with
  • PyroCMS/CodeIgniter
  • Easy
  • as
  • 1
  • 2
  • 3
  • PHP
  • Stuff
  • Raspberry
  • PI