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

Antivirus for Linux

Posted by bonjurkes, 09-17-2008, 05:59 PMHello, I am looking for an antivirus that i can...

grsec WARNING: No module mptscsi found for kernel 2.6.22.9-grsec, continuing anyway

Posted by uploadalerts, 03-27-2008, 04:46 PMHi, I see the following error, while trying to...

Configuring a DR site

Posted by AQORN-Adam, 06-29-2008, 12:31 AMHi everyone, I'm a programmer and not exactly a web...

When blog works forums stops working and viceversa

Posted by sash_007, 03-10-2010, 08:47 PMHello friends, I am having a weird problem my problem is...

Netacore Support Links Broken?

Posted by kjedwards, 09-05-2002, 04:19 AMHi Can anyone tell me how to access Netacore support...