Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Feb 2013 18:38:01 +0000
From:      "Teske, Devin" <Devin.Teske@fisglobal.com>
To:        "tundra@tundraware.com" <tundra@tundraware.com>, FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   RE: Fun Scripting Problem
Message-ID:  <13CA24D6AB415D428143D44749F57D7201EA7EBB@ltcfiswmsgmb21>
In-Reply-To: <511BDB13.3060005@tundraware.com>
References:  <511BDB13.3060005@tundraware.com>

next in thread | previous in thread | raw e-mail | index | archive | help
(apologies for top-post)

As tempted as I am, I think newsyslog(8) may be what you want.

Missing information in your post is how you intend to timestamp the files -=
- by filename? by content? If by-content, then is it a good assumption that=
 the data is one entry per-line? ... and if-so, is the timestamp in that li=
ne? These are all questions that would be needed to script what you're aski=
ng for (not that I'm volunteering or anything like that).
--=20
Devin

________________________________________
From: owner-freebsd-questions@freebsd.org [owner-freebsd-questions@freebsd.=
org] on behalf of Tim Daneliuk [tundra@tundraware.com]
Sent: Wednesday, February 13, 2013 10:27 AM
To: FreeBSD Mailing List
Subject: Fun Scripting Problem

I know how to do this in Python, but I really want to do it in
straight Bourne shell.  I have some ideas, but I thought I'd
give you folks a crack at this Big Fun:

a)  You have a directory of files - say they're logs - generated
     at nondeterministic intervals.  You may get more than one a day,
     more than one a month, none, or hundreds.

b) To conserve space, you want to keep the last file generated
    in any given month (the archive goes back for an unspecified
    number of years), and delete all the files generated prior to
    that last file in that same month.

c) Bonus points if the problem is solved generally for either files
    or directories generated as described above.

These are not actually logs, and no, I don't think logrotate can
do this ... or can it?


--
-----------------------------------------------------------------------
Tim Daneliuk
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"

_____________
The information contained in this message is proprietary and/or confidentia=
l. If you are not the intended recipient, please: (i) delete the message an=
d all copies; (ii) do not disclose, distribute or use the message in any ma=
nner; and (iii) notify the sender immediately. In addition, please be aware=
 that any message addressed to our domain is subject to archiving and revie=
w by persons other than the intended recipient. Thank you.



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