(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: ( cat /path/to/rt/sbin/count-tickets.sh )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!): ( cat /path/to/rt/sbin/shredder.sh )I know that I could have use getopt or getopts for the options, but it wasn't really worth it. Tags: bash script, rt Current Mood: pleased
|