All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Dennis <jdennis@redhat.com>
To: LC Bruzenak <lenny@magitekltd.com>
Cc: Linux Audit <linux-audit@redhat.com>
Subject: Re: audit rotate question
Date: Wed, 20 May 2009 15:13:02 -0400	[thread overview]
Message-ID: <4A14563E.4020207@redhat.com> (raw)
In-Reply-To: <1242844621.6546.149.camel@homeserver>

LC Bruzenak wrote:
> If I do a "service auditd rotate" it just sends the auditd the USR1
> signal which means "start the rotation".
> 
> On a slow/burdened machine with many files this is not immediate.
> 
> I am trying to run a cron job which will :
> 
> mkdir /var/log/audit-archive/
> service auditd rotate
> mv /var/log/audit/audit.log.* /var/log/audit-archive/
> 
> But the files listed are not through rotating so it has issues (file not
> found, leaves behind the last one rotated - audit.log.1, etc.).
> 
> How can I tell when the rotate is complete so I can move the files out?
> I'm sure there is a simple way but I cannot see it.

Set an inotify watch on the *directory*, you'll be able to see when the
files are renamed and created. The package inotify-tools may be of help,
there are also inotify python bindings. If neither of those work for you
I can send C you code which will perform the inotify watch.

-- 
John Dennis <jdennis@redhat.com>

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/

  reply	other threads:[~2009-05-20 19:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20 18:37 audit rotate question LC Bruzenak
2009-05-20 19:13 ` John Dennis [this message]
2009-05-20 19:29 ` Steve Grubb
2009-05-20 19:41   ` LC Bruzenak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A14563E.4020207@redhat.com \
    --to=jdennis@redhat.com \
    --cc=lenny@magitekltd.com \
    --cc=linux-audit@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.