Call Script that Deletes Logs after Stats Run Manually?

Posted by thewird, 01-15-2008, 02:04 AM
I'm trying to create a script to archive logs for 7 days but still delete them from the domlogs daily. Has someone already done this? The ideal solution would be to modify the CPanel script that deletes them after stats run but I'm not sure if thats protected code by CPanel. The other option would be to disable the delete logs after stats run option and to create a script to copy the logs somewhere else via cron and call the script that CPanel uses to delete the logs without restarting apache. This script would also move the files through directories and eventually delete them, therfore preserving the logs for 7 days. Any ideas? I have created an untested script which should do this but I just need to know how CPanel deletes the logs without restarting apache. thewird

Posted by Bilco105, 01-15-2008, 07:20 AM
Take a look at logrotate

Posted by thewird, 01-15-2008, 01:02 PM
I tried that but it doesn't work right. It starts creating backups of backups, and eventually makes the system really slow from the thousands of files. How does CPanel delete the logs without restarting apache? thewird

Hai trovato questa risposta utile?

 Stampa Articolo

Leggi anche

mysql question

Posted by stuffradio, 03-22-2007, 01:21 AMI want to make a member id thing. Example: Member001...

Cronjob issue

Posted by CymraegWalesHosting, 11-16-2012, 11:25 PMHi all, Hopefully this is a simple fix....

data base creator?..

Posted by warlock-m, 02-20-2011, 05:35 PMHello, I'm seeking for a good framework, or simple...

I was thinking...

Posted by Kevin Teoh, 09-21-2001, 10:05 AMI'd like a reseller account where I can give accounts...

Domain parking with Win2k3 DNS??

Posted by bloodsport, 08-03-2007, 09:47 AMHi, i have about 8 different domains i'd like to point...