_DATE_ function in archive

Denis Beauchemin Denis.Beauchemin at USherbrooke.ca
Wed Jun 13 18:56:20 IST 2007


Alex Neuman a écrit :
> IANAPP (in fact, I have *zero* knowledge of Perl), but...
>
> From "message.pm" I see a few lines that say the following:
>
>  $date = sprintf("%04d%02d%02d", $year+1900, $month+1, $day);
>
> and
>
>  if ($archiveplaces =~ /_DATE_/) {
>    # Only do the work for the date substitution if we really have to
>    $archiveplaces =~ s/_DATE_/$date/g;
>    #print STDERR "Archive location is $archiveplaces\n";
>  }
>
> Could I add something like:
>
> $shortdate = sprintf("%04d%02d%02d", $year+1900, $month+1);
$shortdate = sprintf("%04d%02d", $year+1900, $month+1);
>
>  if ($archiveplaces =~ /_SHORTDATE_/) {
>    # Only do the work for the short date substitution if we really 
> have to
>    $archiveplaces =~ s/_DATE_/$shortdate/g;
$archiveplaces =~ s/_SHORTDATE_/$shortdate/g;
>    #print STDERR "Archive location is $archiveplaces\n";
>  }
>
> ... so I could use year+month instead of year+month+date and then 
> rotate/backup my archive once a month if I used the magic string 
> _SHORTDATE_ instead of _DATE_ ?
>
> Thanks in advance...
With my 2 minor corrections it should substitute _SHORTDATE_ for YYYYMM 
wherever this matches (assuming this is in the reports or rules).

Denis

-- 
   _
  °v°   Denis Beauchemin, analyste
 /(_)\  Université de Sherbrooke, S.T.I.
  ^ ^   T: 819.821.8000x62252 F: 819.821.8045


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3595 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.mailscanner.info/pipermail/mailscanner/attachments/20070613/109e3a1b/smime.bin


More information about the MailScanner mailing list