try this...
//...
$dir = "/backup/acornbackup/html/Day";
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if (is_dir($file)) {
list($day, $month, $year) = explode("-", $file);
$created = mktime(0, 0, 0, $month, $day, $year);
$now = mktime(0, 0, 0);
if ($now - $created >= $seconds) { //old
//unlink($file);
`rm -rf $dir/$file`;
}
}
}
closedir($handle);
}
hopefully the backticks will successfully execute the recursive directory removal and the rest should be ok. if not you may need to make a function to go through the directory and unlink all the files individually.