[rt-users] rt-shredder & bash script
Tom Corcoran
tomc at osits.com
Tue Aug 23 11:47:26 EDT 2016
Hi
Noob question here.
Trying to use rt-shredder from a bash script using a bash date variable
to wipeout tickets but shredder seems to ignore my date parameter which
I assume is because its badly formatted.
Have gotten this to work using a fixed date/time -
/#!/bin/sh//
//filename=`date +%Y%m%dT%H%M%S-0001.sql`//
///opt/rt4/sbin/rt-shredder --sqldump
/opt/stf/backups/rt-shredder/$filename --force --plugin Ti//
//ckets=query,"(Queue = 'Supplier invoices') AND status = 'resolved' AND//
// resolved > '2016-08-01 00:00:00.00' ;limit,2000"/
but I would like it to work like this -
/#!/bin/sh//
//filename=`date +%Y%m%dT%H%M%S-0001.sql`//
//cutoff=`date +%Y-%m-%d --date='2 years ago'`//
//cutoff="'$cutoff 00:00:00'"//
//echo $cutoff//
///opt/rt4/sbin/rt-shredder --sqldump
/opt/stf/backups/rt-shredder/$filename --force --plugin Ti//
//ckets=query,"(Queue = 'MCL - Supplier invoices') AND status =
'resolved' AND resolved > $cuto//
//ff ;limit,2000"/
Is this possible from a bash script, any help greatly appreciated.
Kind Rgards
TomC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20160823/0e98329c/attachment.htm>
More information about the rt-users
mailing list