Eric Spakman wrote:
David,

In Bering-uClibc it's fixed in the following way:

        # only keep a week's depth of these
        oldlogs=`find /var/log/ntpstats -type f -mtime +7`
        [ "$oldlogs" != "" ] && rm $oldlogs

As you can see Bering-uClibc uses a newer version of busybox.

Another way I like to do this is with ls and sed:


SAVELOGS=7
oldlogs=`ls -1t <log.file.pattern> | sed 1-${SAVELOGS}d`
[ "$oldlogs" != "" ] && rm $oldlogs

--
Charles Steinkuehler
[EMAIL PROTECTED]


------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click ------------------------------------------------------------------------ leaf-user mailing list: [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html

Reply via email to