August 7th, 2003, 04:17 PM
Join Date: Aug 2003
Time spent in forums: 18 h 56 m 13 sec
Reputation Power: 12
Thanks, Helped a bunch.
| Originally posted by rycamor |
This is really a Unix shell-scripting issue, not a database one, but one quick way to handle this would be to use dates:
mysqldump database_name -u user_name -ppassword > SQL_Back_`date +%Y_%m_%d`
Note: the single quotes in this are backquotes (the top left key over the Tab). This means that the command inside the quotes is executed, and the result is returned as a string. So, your backup files would look like
You could also add minutes to this if you want several backups a day:
mysqldump database_name -u user_name -ppassword > SQL_Back_`date +%Y_%m_%d_%M`
There are many combinations you can do if you play with the date formatting options. Do a 'man date' for more info.