How I go about archiving Zope's log every day?
Can I get logrotate to process the log file?
On Sun, Feb 29, 2004 at 07:03:31PM +0000, John Poltorak wrote:
How I go about archiving Zope's log every day?
Can I get logrotate to process the log file?
Sure you can, I do it every night with a cron job.
The only thing to be careful of is that you want a postrotate script that tells zope to reopen the log file. See doc/SIGNALS.txt to learn how to tell zope that, and the logrotate man page to learn how about postrotate.
Hi Paul,
As with most Zope sites, we are using Apache in front of Zope and therefore using Apache's logging facilities instead of the Z2.log file creating by Zope.
We are now trying to build a backup script to backup our Zope products/data/logs and would like to know how to backup the log files without losing any data.
We are using rdiff-backup and it doesn't like it if the file changes while it's doing the backup. This is why we are packing the database before each backup and backing up the Data.fs.old file instead of the live Data.fs file.
But we would not like to rotate the log files daily just to get a file that we can backup. We'd prefer to rotate the log files monthly, but do daily backups.
Is there a 'best practice' way of handling the backups of these Apache log files? We've had a look at the AWStats FAQ-COM120 ("How to rotate my logs without loosing data"), but this still doesn't explain the issue of backing up the log files without doing daily rotations.
Nate
Paul Winkler wrote:
On Sun, Feb 29, 2004 at 07:03:31PM +0000, John Poltorak wrote:
How I go about archiving Zope's log every day?
Can I get logrotate to process the log file?
Sure you can, I do it every night with a cron job.
The only thing to be careful of is that you want a postrotate script that tells zope to reopen the log file. See doc/SIGNALS.txt to learn how to tell zope that, and the logrotate man page to learn how about postrotate.
----- Original Message ----- From: "Nate Aune" nate@lld.dk To: zope@zope.org Sent: Wednesday, April 21, 2004 5:54 AM Subject: [Zope] Re: Zope & logrotate
Hi Paul,
As with most Zope sites, we are using Apache in front of Zope and therefore using Apache's logging facilities instead of the Z2.log file creating by Zope.
We are now trying to build a backup script to backup our Zope products/data/logs and would like to know how to backup the log files without losing any data.
We are using rdiff-backup and it doesn't like it if the file changes while it's doing the backup. This is why we are packing the database before each backup and backing up the Data.fs.old file instead of the live Data.fs file.
But we would not like to rotate the log files daily just to get a file that we can backup. We'd prefer to rotate the log files monthly, but do daily backups.
Couldn't you write a cron job that will duplicate (or append to new file) the file prior to backing up and backup that file?
I'm also thinking (outloud) that rotating the log at midnight daily would close the old version, and then the only backup you wouldn't have would be the open file from the rotate time to the backup time, which would be backed up the next day.
Maybe i'm not getting the problem.
hth bobb
Is there a 'best practice' way of handling the backups of these Apache log files? We've had a look at the AWStats FAQ-COM120 ("How to rotate my logs without loosing data"), but this still doesn't explain the issue of backing up the log files without doing daily rotations.
Nate
Paul Winkler wrote:
On Sun, Feb 29, 2004 at 07:03:31PM +0000, John Poltorak wrote:
How I go about archiving Zope's log every day?
Can I get logrotate to process the log file?
Sure you can, I do it every night with a cron job.
The only thing to be careful of is that you want a postrotate script that tells zope to reopen the log file. See doc/SIGNALS.txt to learn how to tell zope that, and the logrotate man page to learn how about postrotate.
Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Bobb said:
Sure you can, I do it every night with a cron job.
The only thing to be careful of is that you want a postrotate script that tells zope to reopen the log file. See doc/SIGNALS.txt to learn how to tell zope that, and the logrotate man page to learn how about postrotate.
I read this... http://cvs.zope.org/Zope/doc/SIGNALS.txt?rev=1.3.44.1&content-type=text/...
But could you send an example, currently I have:
postrotate /usr/bin/kill -USR2 `cat /usr/local/zope/var/Z2.pid` endscript
Which I think is dead wrong.
Jake
On Thu, Apr 22, 2004 at 01:16:10PM -0400, Jake wrote:
Bobb said:
Sure you can, I do it every night with a cron job.
The only thing to be careful of is that you want a postrotate script that tells zope to reopen the log file. See doc/SIGNALS.txt to learn how to tell zope that, and the logrotate man page to learn how about postrotate.
I read this... http://cvs.zope.org/Zope/doc/SIGNALS.txt?rev=1.3.44.1&content-type=text/...
But could you send an example, currently I have:
postrotate /usr/bin/kill -USR2 `cat /usr/local/zope/var/Z2.pid` endscript
Which I think is dead wrong.
I don't think that's a valid option to kill, at least not on linux. This is the logrotate conf file that I have:
### begin ####################### compress
/www/logs/z_access_log/current /www/logs/z_big_m_log/current /www/logs/z_event_log/current {
rotate 20 size=100k # run the postrotate command only once, not for each log... sharedscripts postrotate # see doc/SIGNALS.txt in the zope source distribution /bin/kill -s SIGUSR2 `cat /zope/InstanceHome/var/Z2.pid` endscript } ##### end ###################
Paul,
This worked like a charm. I added a FAQ about it.
JMA
On Mon, Mar 01, 2004 at 07:57:31PM +0100, Dieter Maurer wrote:
John Poltorak wrote at 2004-2-29 19:03 +0000:
How I go about archiving Zope's log every day?
Can I get logrotate to process the log file?
Please search the mailing list archive...
How do I do that?
AFAICS there is no search facility on the mailing list archive.
-- Dieter
John Poltorak wrote:
How do I do that?
Hi, this is one way: Point your browser to google.com and fill in the search with this string: log rotate site:mail.zope.org
AFAICS there is no search facility on the mailing list archive.
Also, read the head of this page: http://www.zope.org/Resources/MailingLists
Paolo