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

Was this answer helpful?

 Print this Article

Also Read

EARHOST down!

Posted by davkiz, 08-29-2002, 03:54 AMWow now there's a surprise. It was bound to happen. Their...

Linux: backup hard drive mounted to /backup

Posted by UberTricep, 11-10-2012, 07:49 AMI have a new dedicated server and I ordered a backup...

WHM to point site to home server

Posted by kiwami, 05-04-2007, 12:19 PMwhats up fellers, i'm attempting to point my design site...

How Change Owner?

Posted by hichkas, 07-17-2007, 07:59 AMHi How i Can Change Owner to User! In VPS? Posted by...

DirectAdmin email forwarding not forwarding

Posted by river1, 06-30-2008, 07:20 AMI had email forwarding from a site that I am running on a...