Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!newsfeed.direct.ca!op.net!news.mathworks.com!howland.erols.net!feed1.news.erols.com!news.enteract.com!not-for-mail From: Dannyman <dannyman@dannyland.org> Newsgroups: comp.unix.bsd.freebsd.misc Subject: Newbie: Rotating logfile monthly Date: 2 Jan 1997 21:38:38 GMT Organization: National Semi-Autonomous Republic of Dannyland Lines: 32 Distribution: world Message-ID: <5ah9su$bsk@eve.enteract.com> Reply-To: dannyman@dannyland.org NNTP-Posting-Host: sasquatch.dannyland.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-Newsreader: TIN [UNIX 1.3 unoff BETA release 961126] Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:33518 Okay, here's what I wanna do, prolly via cron :) Wanna rotate my Apache access_log, and other similiar such beasties, every month. Basically, rename the thing with the likes of access_log-[jan-dec]-1997, etc and maybe run compress on it. Now, what buggers me, are what are some cool ways to get a name of the current month, or the previous month, sitting in a script. Some clever dealies with the date command, I suspect, but I'd like to hear whaetver other anecdotal nonsense others have cooked up. :) Also, let's say I just wanted to, at the end ogf each month, whack out the previous month's log and add it in to a compressed file. I've noticed that when you run compress as an apendesque operation(sorry, it's been a while) that you don't get compression on all the data. ie, I had a multi-megabyte log that when compressed hit 200k. When I ran compress to add the same data on to it, filesize doubled. The idea is I wanna compress the entire access_log for it's entire history, not just for the month's worth of data every month. It's nicer to compress many megs in to300k than to compress the same in to an additional 200k/month. Anyways, I think some clever folks might have some inspirational words to share. Thanks! -- =====///==================================================================== ====///===== This message brought to you by dannyman@dannyland.org ========= \\\///========== HOME PAGE! http://www.uiuc.edu/ph/www/djhoward ============ =\XX/Allen=171============================================================== Another lame random tagline, selected by ~dannyman/bin/fortune.pl