I have a cron job for creating a gzip file:

mysqldump... | gzip -c > myfile..sql.gz

I want myfile to be of the format "time_date.sql.gz"

How do I create file with the current date and time?

Thanks

link|improve this question
feedback

1 Answer

up vote 6 down vote accepted
myfile_`date '+%F_%T'`.sql.gz
link|improve this answer
thanks......... – Am. Feb 8 '10 at 16:26
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.