_DATE_ function in archive

Scott Silva ssilva at sgvwater.com
Wed Jun 13 18:19:20 IST 2007


Alex Neuman spake the following on 6/13/2007 10:12 AM:
> 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);
> 
>  if ($archiveplaces =~ /_SHORTDATE_/) {
>    # Only do the work for the short date substitution if we really have to
>    $archiveplaces =~ s/_DATE_/$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...
That probably wasn't thought of since a month could be a very large datafile.

-- 

MailScanner is like deodorant...
You hope everybody uses it, and
you notice quickly if they don't!!!!



More information about the MailScanner mailing list