
April 12th, 2003, 12:01 AM
|
|
|
|
Join Date: Apr 2007
Location: Essex, UK
Posts: 44
Time spent in forums: < 1 sec
Reputation Power: 11
|
|
|
get date in bash script...
Hi,
I have a bash script I run on cron.daily which dumps mysql to file, tars & gzips it, then runs a perl script to email the file to me. This works fine, but the problem is, I have loads of files with the same name, so have rename each daily backup if I want to save them in a backup folder. Is there a way of getting the script to not just name the file, but to append the date on to it as well? The current script is:
#!/bin/sh
/home/local/mysql/bin/mysqldump -uroot -password --opt my_db > /sqldata/my_db.sql
cd /sqldata/
tar -zcvf db_daily.tgz *.sql
cd /myscripts/
perl emailsql.cgi
|