Shortcut Question
I have in my crontab file a backup script that runs every day. I want to redirect this output to a new log file each day with the following format...
backup-(date).log Aren't there shortcuts that I can put in the command that will achieve this? Something like... backup (directory) (files) > backup\d.log Or something like that? |
You could do something like:
---- $LOG="/var/log/backup.`date` # Or you could use `date +%m%d+%y` (Month, Day, Year) /sbin/dump -0u -f /dev/tape /dev/hda? > $LOG ----- Remember though, that the > operator will overwrite any existing data in that file. Use >> to append the data to the end of the file. |
Could I use the command substitution in the redirection and eliminate the use of the variable? It doesn't matter, but I am curious.
Thanks a bunch for the response. :) |
All times are GMT -5. The time now is 01:08 AM. |