0

in my /var/lib/awstats, awstats creates monthly .txt files (its database).

Once these files are created and I have my graphics created in Awstats, can I delete the old log files created by Apache? Those found, generally, in /var/www/logs/ (the combined log file)?

This file is getting huge and I want to get rid of it (close to 0.5 Gb).

Also, what happens if I delete .txt files in /var/lib/awstats, do I loose this data?

Thanks

4
  • Have you setup log rotation for apache log?
    – masegaloeh
    Sep 19, 2014 at 12:01
  • No I haven't setup rotation. Sep 19, 2014 at 12:04
  • Then you should setup it before the log eat your HD space :)
    – masegaloeh
    Sep 19, 2014 at 12:07
  • Yeah, I have to, now that I've seen the size of the apache log files!!! Sep 19, 2014 at 12:15

1 Answer 1

1

Sure, once awstats has finished processing your log files, you can delete them. Of course then you won't be able to go back and look at them for anything else, such as intrusion detection. Or if you were later adding other metrics to awstats, you wouldn't be able to calculate them on the period covered by the deleted logs, since it would have to go back through and reprocess them to do that.

But yes, it's standard practice to regularly rotate log files, and delete the oldest ones. How long to keep them depends on your installation. A log rotation tool such as logrotate can automate the process.

1
  • Thanks for the heads up on logrotate, I will check it out and set it up. Sep 19, 2014 at 12:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .