SET DAY=%DATE:~4,2%
SET MTH=%DATE:~7,2%
SET YR=%DATE:~10,4%
SET HR=%TIME:~0,2%
SET HR0=%TIME:~0,1%
IF "%HR0%"==" " SET HR=0%TIME:~1,1%
SET MIN=%TIME:~3,2%
SET SEC=%TIME:~6,2%
SET MYDATE=%YR%%MTH%%DAY%_%HR%%MIN%%SEC%

SET mysrv=localhost
SET myuser=root
SET mypswd=root
SET myport=50002
SET mydbase=peg_erp

mysqldump -h%mysrv% -u%myuser% -p%mypswd% -P%myport% %mydbase% > %MYDATE%.sql
