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

Hjälpte svaret dig?

 Skriv ut denna artikeln

Läs även

Setup extra mailserver for newsletters

Posted by dream_th, 06-29-2008, 12:22 PMHi, I have problems to express with my english but i...

Changing File ext. to File

Posted by haleyhosting_com, 03-24-2007, 01:31 PMi have a site upithere.com . its a pretty popular...

flushing iptables

Posted by hazarus, 09-16-2007, 04:34 AMhello, I keep trying to flush my iptables on my linux...

I need help faster! - Looking again

Posted by johnpalm, 09-06-2002, 12:18 PMOver the past 6 months I had a number of reseller account...

How do I control the number of user downloading and the download speed?

Posted by celular, 09-20-2008, 11:04 PMhello, I am planning to rent a dedicated server with...