Deleting a Range of Tickets in Trac

Recently the Open Yahtzee website which runs Trac has fallen victim to several spam attacks. The spammers submit large number of tickets containing links to various sites. This post was written mainly to allow me to copy paste a command to delete a range of tickets at once, but I thought it may be useful to others as well.

for i in `seq FROM TO`; do trac-admin TRAC_ENV ticket remove $i ; done

Replace FROM and TO with the first and last ticket numbers of the range accordingly. TRAC_ENV should be the path to your project’s environment.

For example:

for i in `seq 9 32`; do trac-admin www.openyahtzee.org/ ticket remove $i ; done

2 thoughts on “Deleting a Range of Tickets in Trac”

  1. In the few days since I wrote the draft of the post until I published it, the Open Yahtzee site got spammed more often and ever. So, finally I installed the SpamFilter plugin for Trac, and enabled the Akismet filtering, which seems to work (at least for now).

  2. Thanks that was EXACTLY what I needed. Like you, I’m also now running the TracSpamFilter plugin with the Akismet filter. An absolute necessity after gathering 600 spam tickets in a month. I couldn’t find a way to trigger Akismet to look at existing tickets, so your bash script was the perfect solution, tx Guy.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.