> I'd like to know how I can redirect the output of a program (eg. backup) to a
> log file using today's date. eg. LG960807.LOG as log file name.
Here's my answer from my company's FAQ:
How can I create a Unix file with the current date/time in its name?
Say, for instance, that you were running a given command, and wanted
its output to go to a log file that had the date in the file name in
YY_MM_DD format. (You might want to do this so that the file will
not be overwritten on a subsequent day when the command gets
restarted.) The date command has options allowing you to specify the
format of its output:
nohup command >command.log.$(date +%y_%m_%d) &
Remember that you may want to specify the time down to the second if
you want to nearly eliminate the possibility of ever overwriting a log
file. (Another option would be to put the date and a sequence number in
the log file name.)
See the date man page for details on other format specifiers.