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

---------
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017

Reply via email to