Need a script to move files where their last mod date <= 'xx MMM yyyy'

Evan evan_lsa at internode.on.net
Fri Nov 17 05:05:57 CST 2006


Hi Shaun,
I tried it and it didnt change I also tried stat($a)[9] (different doco) 
and it shows me 9th of Nov then 10th then the end of the list shows the 
9th again. It seems to sort part of it but that could be just luck.

proxsmtpd.SchhSA.spam ' '1163737836 ' '20061117_15:00:36
proxsmtpd.GDoHWp.spam ' '1163737884 ' '20061117_15:01:24
proxsmtpd.5jICco.spam ' '1162999205 ' '20061109_01:50:05
proxsmtpd.XrPcj5.spam ' '1162999420 ' '20061109_01:53:40
proxsmtpd.XLEsGz.spam ' '1162999512 ' '20061109_01:55:12
proxsmtpd.ydWarm.spam ' '1162999657 ' '20061109_01:57:37



shaun etherton wrote:
> HI,
>
> Evan wrote:
>> Evan wrote:
>>
>> sub by_last_mod {
>>  # vars $a and $b automatically passed in
>>  # perl function 'stat' returns array of info on a file
>>  # 10th element of the stat array is last modified date,
>>  # returned as number of seconds since 1/1/1970.
>>  my $adate = (stat(a))[10]; # get last modified date
>>  my $bdate = (stat(b))[10]; # get last modified date
>>  return $adate <=> $bdate;
>> }
>
> should be using $a and $b not a and b I think.
>
>



More information about the linuxsa mailing list