shell command script question....
All right, I am in the process of putting together a small command script to run my IP monitoring software app (iptraf) on my server at boot time. Basically I am wanting it to run in the background and log my traffic. The question I have, is I want to put the current date in the log's filename when it originally gets created. How would I accomplish this? I have seen with some commands that it usually consists of a percent sign followed by some letter (ex: %M) to do certain things similar to what I am wanting...is that basically what I need to do?
|
Review the date(1) manpages (FORMAT section). Example:
Code:
[hector@troy ~]$ FILENAME=mylog$(date +%Y%m%d).log |
Awesome, thanks. :)
I was kinda figuring that's what I'd have to do but just thought I'd double check to be sure. |
All times are GMT -5. The time now is 09:46 AM. |