My favorite bittorrent tracker just went down for good after a long run, and now I'd like to do some cleanup -- specifically I want to purge the 2000 or so torrent files from just that tracker out of my torrents directory. I can write a perl script to run a tool like aria2c and then parse the output for the Announce field, but that seems overly complicated. Is there an easier way?


I went ahead and wrote a script to do this. It's a little fussy because torrent file names frequently contain spaces and other unix-unfriendly characters, but it works. I'm using transmission-show to read the torrent files because it comes loaded with my client, but you could look at the answers to "is there a tool to view a torrent file?" for a list of other tools.


@files = `ls -1`;
  $current = $_;
  $out = `transmission-show "$current"`;
  if($out =~ /INSERT\.TRACKER\.HERE/){
    system("mv \"$current\" ../destination_folder");

Be sure to create a backup of your torrents directory first

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.