[rt-users] Automatically Deleting Ticket Attachments Matching Name

Zoey Schutt zoey at braincoral.io
Thu Jul 30 14:48:48 EDT 2015



That worked perfectly, thanks a lot!


I’ve got a cron job running that command after my nightly backup, and it’s exactly what I needed.


0 4 * * * root /opt/rt4/sbin/rt-shredder --plugin 'Attachments=limit,1000;files_only,1;file,smime.p7s' –force




Zoey Schutt


From: Nathan Baker [mailto:bakern at gmail.com] 
Sent: Tuesday, July 28, 2015 12:16 PM
To: Zoey Schutt <zoey at braincoral.io>
Cc: RT User List <rt-users at lists.bestpractical.com>
Subject: Re: [rt-users] Automatically Deleting Ticket Attachments Matching Name


Have you tried something like this:


rt-shredder --plugin 'Attachments=limit,1000;files_only,1;file,smime.p7s'


That should delete only attachments with the name you mentioned, and will limit it to 1000 attachments which you can adjust.


On Tue, Jul 28, 2015 at 8:52 AM, Zoey Schutt <zoey at braincoral.io <mailto:zoey at braincoral.io> > wrote:



RT Instance Info:


Debian GNU/Linux 7 (wheezy)

Apache/2.2.22 (Debian)

Request Tracker 4.2.11

OpenSSL 1.0.1e 11 Feb 2013

perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-gnu-thread-multi




I have been searching for a way to do this, but I haven’t been able to find a good way to get this working. I’m trying to figure out a way to get Request Tracker to automatically delete ticket attachments with a specific name, in this case “smime.p7s”. Essentially all outgoing emails in my Request Tracker instance are signed, and every email Request Tracker sends attaches a “smime.p7s” file to the ticket. I just need a way to get these attachments deleted automatically, as they are not needed.


I’ve attached a screenshot of the attachments pane of a ticket that’s been worked on for a few days as an example.


I was thinking a cron job running rt-shredder might work, but I can’t figure out a way to delete attachments by name, only via transaction ID.


Any assistance would be appreciated!




Zoey Schutt


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20150730/025566ab/attachment.htm>

More information about the rt-users mailing list