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

?האם התשובה שקיבלתם הייתה מועילה

 הדפסת המאמר

קראו גם

CNAME or A record in DNS Zone?

Posted by olddocks, 01-14-2008, 08:14 AMi have just created a dns ZONE for my domain, but i dont...

identd daemon

Posted by HD Fanatic, 07-15-2007, 03:48 PMWhat's the most popular identd daemon for Linux? I need...

Sending commands to a socket (C++)

Posted by LindonNetworks, 09-19-2008, 05:53 PMI'm trying to write an SMTP wrapper and I'm...

question about IP

Posted by wiredhosting, 07-17-2007, 11:16 AMHello everyone, i have 1 free IP in my dedicated...

javascript dies in php

Posted by ti_nhatrang, 01-17-2008, 06:49 AMHi guys, I can't seem to put this in a echo...