Re: how to automatically increment a filename?
- From: noi <noi@xxxxxxxx>
- Date: Wed, 07 Dec 2005 19:18:49 GMT
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
.
- References:
- how to automatically increment a filename?
- From: Anthropic Aorta
- how to automatically increment a filename?
- Prev by Date: Re: change lilo's config from windows? is it possible?
- Next by Date: Serial to USB device
- Previous by thread: Re: how to automatically increment a filename?
- Next by thread: change lilo's config from windows? is it possible?
- Index(es):