In dialup admin's perl goodies, 'clean_radacct' and 'truncate_radacct' subtract a $days_back value of 35 or 90 from the current day of the month (say 28). This results in negative values for the day of the month, so the date passed to mysql is not formatted correctly.

$back_days = 90;
...

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
$date = POSIX::strftime("%Y-%m-%d %T",$sec,$min,$hour,($mday - $back_days),$mon,$year,$wday,$yday,$isdst);
print "$date\n";
...


To fix, use unix time or Date::Calc

$back_days = 90;
$secs = (time()-($back_days*86400));
....

$date = POSIX::strftime("%Y-%m-%d %T",localtime($secs));
print "Removing sessions with Stop Time < $date\n";
....

Ken A


- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to