Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mysql backup using date as file name
Message
From
02/08/2013 10:22:31
Hee Lim Wang
Fantasy Software Enterprise
Malaysia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Mysql backup using date as file name
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01579739
Message ID:
01579739
Views:
43
Hi all
I want to backup mysql and using date as backup file name
I wrote a bat file.....

echo Date format = %date%
echo mm= %date:~0,2%
echo dd= %date:~3,2%
echo yyyy = %date:~6,4%
echo.
echo datestamp = %date:~6,4%-%date:~0,2%-%date:~3,2%
mysqldump -umyuser -pmypassword mydatabase > "backup-%datestamp%.sql"

but the output file name is just "backup-.sql" only
how to make the file name something like "backup-2013-08-02.sql"
Thanks !
Reply
Map
View

Click here to load this message in the networking platform