
August 7th, 2003, 03:17 PM
|
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 141
  
Time spent in forums: 18 h 56 m 13 sec
Reputation Power: 11
|
|
Thanks, Helped a bunch.
Quote: 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
SQL_Back_2003_08_05
SQL_Back_2003_08_06
SQL_Back_2003_08_07
etc...
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. |
|