Re: how to automatically increment a filename?



On Tue, 06 Dec 2005 19:32:45 +0000, Anthropic Aorta wrote this:

> I want to schedule a cronjob to do some ping tests and dump the output
> into a series of files. I want the filenames to automatically increment
> like "ping1.txt" "ping2.txt" etc. rather than just appending to one large
> file. Is this possible?
>
> Also, what would be the simplest way to automatically email this file to
> me, should I learn how to use sendmail?
>
> Thx.

I like to cronjob shell scripts so I can use variables and change the
scripts without su privileges.

I'm using a timestamp

t3=$(date +%H%M%S)
H=${1-$DEFAULT}
ping -c 10 $H > ping$t3.txt
mutt -S subject -a ping$t3.txt noi@xxxxxxxx < /dev/null


.