From owner-freebsd-stable@FreeBSD.ORG Sun Jul 31 17:26:56 2011 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C630106566C for ; Sun, 31 Jul 2011 17:26:56 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3CC6C8FC16 for ; Sun, 31 Jul 2011 17:26:56 +0000 (UTC) Received: by yxl31 with SMTP id 31so3641468yxl.13 for ; Sun, 31 Jul 2011 10:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=dWWvrSdNxuTWtMx4AoW+rNU048PMx+NQBlZLJ7DnR3w=; b=RmyNhRGkfIA+iQbPrVW+iOpSO3TGTNGYzsMXnrmQBHhqo/3hmc7QCkS3FFuWzjAQbW /1lFNYxDKyKAJVkdWWTLBGdeNfnIGRkgNMmBDqAfls99XXeLyF6FD+H8gey4gdE+JN3U TPLW6onZXOYUktAxSrqYEzMzGQP3SgAC0rErQ= MIME-Version: 1.0 Received: by 10.91.65.1 with SMTP id s1mr2546455agk.121.1312131425970; Sun, 31 Jul 2011 09:57:05 -0700 (PDT) Received: by 10.90.209.12 with HTTP; Sun, 31 Jul 2011 09:57:05 -0700 (PDT) In-Reply-To: <4E35881C.2010505@rdtc.ru> References: <4E35881C.2010505@rdtc.ru> Date: Sun, 31 Jul 2011 09:57:05 -0700 Message-ID: From: Freddie Cash To: Eugene Grosbein Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: stable@freebsd.org Subject: Re: running newsyslog fiveminly X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 17:26:56 -0000 Simplest solution is to have two separate config files for newsyslog, and to edit /etc/crontab to point it at the two separate configs. One job runs every 5 mins, the other runs normally. I do this with three separate config files for different sets of logs that need to be rotated into different directories at different times. On Sun, Jul 31, 2011 at 9:51 AM, Eugene Grosbein wrote: > Hi! > > Suppose, there is a machine which writes two kinds of log files through > syslogd: > quickly-growing that need to be rotated based on their size (hourly is too > seldom) > and other that should be rotated once a day, at midnight only. > > For first kind of logs we have to run newsyslog once every 5 minutes using > cron: > > */5 * * * * root newsyslog > > For second kind of logs we have lines in newsyslog.conf such as following: > > /var/log/mpd.log 640 16 * @T0000 JC > > This must ensure that /var/log/mpd.log is rotated and compressed at midnigt > only. > Note, that compressing the file takes 8 minutes. > > However, every night at 00:05 I get an error: > > bzip2: I/O or other error, bailing out. Possible reason follows. > bzip2: No such file or directory > Input file = /var/log/mpd.log.0, output file = > /var/log/mpd.log.0.bz2 > newsyslog: `bzip2 -f /var/log/mpd.log.0' terminated with a non-zero status > (1) > > It seems, newsyslog still wants to process my file at 00:05 despite @T0000 > time specification. Is it broken? > > Eugene Grosbein > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" > -- Freddie Cash fjwcash@gmail.com