<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi<br>
    <br>
    Noob question here.<br>
    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.<br>
    <br>
    Have gotten this to work using a fixed date/time -<br>
    <br>
    <i>#!/bin/sh</i><i><br>
    </i><i>filename=`date +%Y%m%dT%H%M%S-0001.sql`</i><i><br>
    </i><i>/opt/rt4/sbin/rt-shredder --sqldump
      /opt/stf/backups/rt-shredder/$filename --force --plugin Ti</i><i><br>
    </i><i>ckets=query,"(Queue = 'Supplier invoices') AND status =
      'resolved' AND</i><i><br>
    </i><i> resolved > '2016-08-01 00:00:00.00' ;limit,2000"</i><br>
    <br>
    but I would like it to work like this - <br>
    <br>
    <i>#!/bin/sh</i><i><br>
    </i><i>filename=`date +%Y%m%dT%H%M%S-0001.sql`</i><i><br>
    </i><i>cutoff=`date +%Y-%m-%d --date='2 years ago'`</i><i><br>
    </i><i>cutoff="'$cutoff 00:00:00'"</i><i><br>
    </i><i>echo $cutoff</i><i><br>
    </i><i>/opt/rt4/sbin/rt-shredder --sqldump
      /opt/stf/backups/rt-shredder/$filename --force --plugin Ti</i><i><br>
    </i><i>ckets=query,"(Queue = 'MCL - Supplier invoices') AND status =
      'resolved' AND  resolved > $cuto</i><i><br>
    </i><i>ff ;limit,2000"</i><br>
    <br>
    Is this possible from a bash script, any help greatly appreciated.<br>
    <br>
    Kind Rgards<br>
    TomC<br>
    <br>
  </body>
</html>