Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save payamomrani/fddae85cf6779bc842e88996546006d4 to your computer and use it in GitHub Desktop.
Save payamomrani/fddae85cf6779bc842e88996546006d4 to your computer and use it in GitHub Desktop.
@echo off
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set mytime=%%a%%b)
SET backupdir=C:\xampp\htdocs\backup
SET mysqluername=root
SET mysqlpassword=password
SET database=dbname
C:\xampp\mysql\bin\mysqldump.exe -u%mysqluername% -p%mysqlpassword% %database% > %backupdir%\%database%_%mydate%_%mytime%.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment