Hi, i would like to delete the logs file that are in data/private/logs
but I can't neither from ftp nor control panel. how i will delete these files. i dont want to delete everything, only old files
thanks
Moderators: OldWolf, re*s.t.a.r.s.*2
<?php
// recurses into a directory and empties it
// copy this code in a text file and name it something like pfc_purge.php
//place it at the root of your site (to avoid open_basedir restrictions)and call it with your browser
//be careful, don't proceed if you don't understand this
//use at own risk
function purge($dir)
{
$handle = opendir($dir);
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
if (is_dir($dir.$file))
{
purge ($dir.$file."/");
rmdir($dir.$file);
}
else
{
unlink($dir.$file);
}
}
}
closedir($handle);
}
?>
<?php
//adjust your paths to reflect your setup
//comment out the directories you don't want to clear
//ATTENTION this code deletes everything in these directories
//backup files you want you keep first
purge("/home/usr/www/chat/data/private/cache/");
purge("/home/usr/www/chat/data/private/chat/");
purge("/home/usr/www/chat/data/private/logs/");
echo "Succesfully cleared the PhpFreeChat cache, chat and logs directories";
?>
Return to General Support (v1.x)
Users browsing this forum: No registered users and 36 guests