Adding date to filename in a shell script

hi I have tar -cf /home/1.tar *.* in a script to do a Daly backup with I need is to change 1.tar to the date i.e. 1-2-04.tar etc i am guessing the clock or date commands would need to be used thanks
kingpin200004Asked:
Who is Participating?
 
joespConnect With a Mentor Commented:
Here's my little mysql backup script.  
#!/bin/sh
present=`date +%b%d%y`
mysqldump -uUSERNAME -pPASSWORD --databases THIS_ONE_DB > $present.sql

which produces files like
~
Feb1604.sql

god bless
0
 
Pete LongTechnical ConsultantCommented:
Theres a Perl Script here that includes the funtionality you are after?
http://www.imagefolio.com/resources/mods/backup/index.txt
Pete
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.