[NTLUG:Discuss] Script question
Fred James
fredjame at concentric.net
Sat Jan 5 21:13:35 CST 2002
Don't get me wrong - that is a very interesting little gizmo, and one
which I may find very useful, too.
The credit lines at the end of the man page read: "Author, Erik Troan
<ewt at redhat.com>" - I haven't found logrotate on any of the other UNIXs
I work with, is it on distributions of Linux other than Red Hat?
sysmail at glade.net wrote:
> Wouldn't logrotate do all this a lot easier?
>
> Just a thought,
>
> Carl
>
> On Fri, 4 Jan 2002, Paul Ingendorf wrote:
>
>
>>Date: Fri, 4 Jan 2002 23:40:18 -0600
>>From: Paul Ingendorf <pauldy at wantek.net>
>>Reply-To: discuss at ntlug.org
>>To: discuss at ntlug.org
>>Subject: RE: [NTLUG:Discuss] Script question
>>
>>hmm shell scripts yum gotta throw in how I would do it even though I see a few fine examples have already been posted.
>>The following would also move the files appropriately. Just copy and paste this in a file chmod +x it and remember to create the new backup file as /archive/domains.`date +%Y-%m-%d` and it should work properly every time.
>>
>>#!/bin/bash
>>rm -f /archive/*.3
>>let x=3
>>for file in /archive/domains.[0-9][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9].[0-3]
>> do
>> mv $file /archive/`echo $file | sed -e "s/\.[0-9]^//g"`.$x
>> let x=$x-1
>> done
>>mv /archive/domains.`date +%Y-%m-%d` /archive/`date +%Y-%m-%d`.0
>>
>>
>>
>
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
>
>
>
--
...make every program a filter...
More information about the Discuss
mailing list