Hi Mike,

Your script to 'logrotate' the files could look like this:

#!/bin/sh

filetest()
{
if [ -f wireless_stat$1.tar ] ; then
       mv -f  wireless_stat$1.tar wireless_stat$2.tar
fi
}

cd /<directory where your files are>
filetest 4 5
filetest 3 4
filetest 2 3
filetest 1 2

The filetest function takes 2 arguments, being the oldest and one newer file (you can expand this check to as many as you like, but if you want to keep things around forever, this would not be the best way to do it).

To run this thing, put it somewhere and let root's cron take care of things.

Paul

On 01/04/2004 05:05 PM, mike wrote:

Greetings and Happy NewYear,
I would like to write a script to accomplish a task, and then run it at regular
intervals (I'll start another thread for that). The thing is I know zero about programming and in process of learning.



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to