|
how to use environment variable as part of filename
occasionally I run a script that somemtimes fails. That it fails is irrelevant as it dumps errors into a .log file. What I'd like to do though is have the script automatically rename the .log file to a unique name that uses the date environment variable as part of the filename.
example: script fails on 07-10-2006 at 19:30.
The script will sense it die, but should
1)copy existing .log file to failed_$date.txt
2)echo 'plz rerun script'
.....aaaaaand if it fails again it doesn't hurt my previously copied off file because it's unique by using the date (and time) as the filename.
Only I don't know how to set it up. Any ideas?
|