Delete_dead_tickets.pl

Where can i find the Steve Poirier’s delete_dead_tickets.pl script?

I have been looking the list archives, and i want to delete some old
tickets to minimize the database size.

Thanks

Steve’s script saved my ass and my DB :-). Here is a modified version of his script to do cleanup on very large MySQL DB’s.

Don’t forget to add those index’s

**** snip sent to Steve ****
Steve,
Thank you for putting together the delete dead tickets script. I found
that on our system (a really slow one) that the script took over 24 hours to
delete 3-4 thousand records so I asked one of our Perl/MySQL programmers to
check out the code. They made the edits you see in the attachment. We also
added indexes on the tables that matched the where clause. With the edits
and indexes it rips trough a few thousand records in minutes. Hope you will
find the edit satisfactory.

Here is a link to his original script also.

http://dev.inet-technologies.com/rt2/

Greg
Greg Dickerson
Support Manager
O’Reilly & Associates, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
Phone:(707)827-7215----- Original Message -----
From: “Carles Amig�” carles@inlander.es
To: rt-users@lists.fsck.com
Sent: Wednesday, November 14, 2001 8:29 AM
Subject: [rt-users] delete_dead_tickets.pl

Where can i find the Steve Poirier’s delete_dead_tickets.pl script?

I have been looking the list archives, and i want to delete some old
tickets to minimize the database size.

Thanks


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Cleanup-Dead.zip (1.11 KB)

This script is flawed. It has a SQL statement “DELETE FROM Watchers WHERE
Value=?”. This statement will delete any queue AdminCcs (and maybe queue Ccs
too) whose userid matches the ticket number that you’re deleting. I told
Steve about this, but he dismissed it. The proper SQL statement should be:

“delete from watchers where Scope = ‘Ticket’ and Value = ?”

O- ~ARK