Gossamer Forum
Home : General : Perl Programming :

Date for tar

Quote Reply
Date for tar
How could I add a date format when taring a file on Unix. I saw this information but now cant find it.

Thanks!


Quote Reply
Re: Date for tar In reply to
Try this...

tar cvf `date +destinationfilename_%m-%d-%y.tar` filetotar

This gives you: destinationfilename_07-05-01.tar

Just change around %m-%d-%y to suit your country date format.

Eraser:
Insight Eye
http://www.insighteye.com/