Tags: bash script

Geek

RT ticket count

(This was cross posted in itprofessionals)

When dealing with a large ticket db in RT (Request Tracker), it's sometimes good to flush the db of some tickets.

RT /never/ deletes data from the dB. There's a 'plugin'/add-on or whatever that can though. RTx-Shredder.

However, if someone set's a script in action to 'shred' those tickets, one will occasionally want to check in on how it's going.

Hence this script:
Collapse )

That script, of course, requires you to have my.cnf setup correctly or ran as root with no root mysql pw set.

One /can/ get the ticket count from RT for most any status - except for deleted.

We started with approx 55500 tickets in rejected status (spam!), and we're currently down to approx 11300. The shred process has been running for approx a week and a half, and it should finish sometime this friday evening. That's approx 1 ticket shredded per 17 seconds.

Also, here's the script I'm using to shred those tickets (long!):

Collapse )

I know that I could have use getopt or getopts for the options, but it wasn't really worth it.
Geek

Need a geek icon...

My new fav one-liner:

while true ; do clear ; date ; echo ; ls -lh ; REPLY="" ; read -sn 1 -t 1 ; if [ "$REPLY" = "q" ] ; then break ; fi ; done

It'll watch a directories contents (via ls), prefixed with the current time. It'll refresh every second until you hit the 'q' key - or faster if you hit any other key.