How to Terminate Transmission-Cli

I am using ruby script to download bitcoin bootstrap.dat file, This file can only be downloaded by using torrent client so to download on command line i am using following ruby demo script:

#!/usr/bin/ruby env
`transmission-cli 

Now i run that script

root@master:~# ruby demo

But that script hangs because above transmission downloads torrents file perfectly but after that it start to seeding and uploading and never terminate automatically, Is there any way i can terminate this using my script?

Is there any way by which i can send kill or termination signal after torrent download finished?

1 Answer

You can use the -f, -finish <script> which executes a script when the download is completed:

tmpfile=$(mktemp)
chmod a+x $tmpfile
echo "killall transmission-cli" > $tmpfile
transmission-cli -f $tmpfile your.torrent

You could also use rtorrent which has more options.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest