Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Dec 2001 17:19:10 -0000
From:      "Barry Byrne" <barry.byrne@wbtsystems.com>
To:        <xphilius@yahoo.com>, <freebsd-questions@FreeBSD.ORG>
Subject:   RE: newsyslog - backup logfile question
Message-ID:  <NCBBIAMNAKDKFJIIGNPKIEDOGMAA.barry.byrne@wbtsystems.com>
In-Reply-To: <20011205164234.50132.qmail@web11801.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Jason:

Making a date-stamped directory could be done something like:

#!/bin/sh
DATE=`date +%Y_%m_%d`
BACKUPDIR="log_backup/logs$DATE"

the date command is pretty flexible - man date if you need something
different.

 - Barry

--
Barry Byrne


> -----Original Message-----
> From: owner-freebsd-questions@FreeBSD.ORG
> [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of X Philius
> Sent: 05 December 2001 16:43
> To: freebsd-questions@FreeBSD.ORG
> Subject: Re: newsyslog - backup logfile question
>
>
> Louis,
> I had the same thought about moving logs/*.gz to a folder on a regular
> basis. How about setting up a simple shell script to move *.gz to a
> folder named with the date, log_backup/logs_12_05_01/ or some such?
> That way the numbered *.gz files won't get over written. Its a simple
> solution, but should accomplish our goal! I am a /bin/sh newbie, so I
> honestly haven't figured out how to get the date, formatted nicely for
> a folder name, into a variable yet, but I am quite sure it is easy ;-)
>
> Jason
>
> --- Louis LeBlanc <leblanc+freebsd@keyslapper.org> wrote:
> > Quick question about newsyslog.  I suspect it's not possible, but it
> > can't hurt much to ask, right?
> >
> > I often go thru logs on a daily basis, and often have to sort thru
> > the
> > directory to find the current logs.  I wonder if it is possible to
> > have newsyslog, in addition to gzipping old logs, to put all gzipped
> > backups into a ./bak/ directory?  I know it has to know how many
> > backups it has kept, so I can't just move *.gz files in on a regular
> > basis - that would screw things up.  I found nothing in the manpage,
> > and I'm not sure where else to look.
> >
> > Obviously this would be an easy enough feature to add, but I'm not
> > inclined to put yet another rod in the furnace just yet.
> >
> > Thanks in advance.
> > Lou
> > --
> > Louis LeBlanc               leblanc@keyslapper.org
> > Fully Funded Hobbyist, KeySlapper Extrordinaire :)
> > http://www.keyslapper.org                     T?T,
> >
> > Mencken and Nathan's Fifteenth Law of The Average American:
> >   The worst actress in the company is always the manager's wife.
> >
>
> > ATTACHMENT part 2 application/pgp-signature
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Buy the perfect holiday gifts at Yahoo! Shopping.
> http://shopping.yahoo.com
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?NCBBIAMNAKDKFJIIGNPKIEDOGMAA.barry.byrne>