Forum Moderators: open

Message Too Old, No Replies

Enter a time stamp when using mysql dump

         

Sonnenblume

11:17 am on Feb 28, 2007 (gmt 0)

10+ Year Member



Im using windows to schedule a mysql backup via mysql dump and windows scheduling tasks. Everything works fine, but the one thing I want to do is add a timestamp in the output file. Currently my query looks like this...

mysqldump --opt -uUsername -pPassword products> c:\backup.sql

What im after is something like this....

mysqldump --opt -uroot -p1ojrtl1! products> c:\backupTIMESTAMP.sql

Whats the best way to achieve this?

milanmk

2:55 pm on Feb 28, 2007 (gmt 0)

10+ Year Member



Try %TIME% and %DATE% in your query like this:-

mysqldump --opt -uUsername -pPassword products > c:\backup%DATE%.sql

Well, i have never tried it but it should work.

Milan