transmission/docs/Scripts.md

3.6 KiB

Transmission Scripts

Introduction

Thanks to the powerful RPC, transmission-remote can talk to any client that has the RPC enabled. This means that a script written using transmission-remote or RPC can, without rewrite, comunicate with all the Transmission clients: Mac, Linux, Windows, and headless.

Mac OS users may wonder wether there will be Applescript scripts, the answer is ''no''. Although Applescript is a nice technology, it's a pain to implement. However, Mac OS X is a Unix after all, so any script you find here will also work on the Mac. Even from within Applescript, you can run these scripts by typing: do shell script "path/to/script".

How-To

If you are interested at writing scripts for Transmission, have a look at the following pages:

  • [wiki:man Transmission man pages]
  • [wiki:ConfigFiles Configuration Files]
  • [wiki:EditConfigFiles Editing Configuration Files]
  • [wiki:EnvironmentVariables Environment Variables]
  • [wiki:rpc RPC Protocol Specification]

For those who need more information how to use the scripts, have a look at the following links:

Scripts

Start/Stop

  • [wiki:Scripts/initd init.d script] (Debian, Ubuntu and BSD deratives)
  • [wiki:Scripts/runscript runscript] (Gentoo and other runscript-compatible systems)

On Torrent Completion

Transmission can be set to invoke a script when downloads complete. The environment variables supported are:

  • TR_APP_VERSION - Transmission's short version string, e.g. 4.0.0
  • TR_TIME_LOCALTIME
  • TR_TORRENT_BYTES_DOWNLOADED - Number of bytes that were downloaded for this torrent
  • TR_TORRENT_DIR - Loation of the downloaded data
  • TR_TORRENT_HASH - The torrent's info hash
  • TR_TORRENT_ID
  • TR_TORRENT_LABELS - A comma-delimited list of the torrent's labels
  • TR_TORRENT_NAME
  • TR_TORRENT_TRACKERS - A comma-delimited list of the torrent's trackers' announce URLs

[https://trac.transmissionbt.com/browser/trunk/extras/send-email-when-torrent-done.sh Here is an example script] that sends an email when a torrent finishes.

Obsoleted

Functionality of these scripts has been implemented in libtransmission and is thus available in all clients.

  • [wiki:Scripts/EmailNotifier Email Notification Script]
  • [wiki:Scripts/BlockListUpdater Block List Updater]
  • [wiki:Scripts/Watchdog Watch Directory Script]
  • [wiki:Scripts/Scheduler Bandwidth Scheduler]

contrib/scripts

Tomas Carnecky (aka wereHamster) is maintaining a set of scripts in his [http://github.com/wereHamster/transmission/tree/master/contrib/scripts/ github repository].

Falk Husemann (aka hxgn) is maintaining scripts in his [http://falkhusemann.de/blog/category/tcp_ip/transmission-tcp_ip/ blog].

oguz wrote [http://oguzarduc.blogspot.com/2012/05/transmission-quit-script-in-php.html on his blog] a PHP script to stop Transmission after it finishes downloading and seeding. Scripts which have not yet been ported and may not work with the latest version: