Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. :: switch to the "data" folder
  2. pushd "%mysqlDataDir%"
  3. :: create backup folder if it doesn't exist
  4. if not exist %backupDir%%dirName% mkdir %backupDir%%dirName%
  5. :: iterate over the folder structure in the "data" folder to get the databases
  6. for /d %%f in (*) do (
  7. :: remove echo here if you like
  8. echo processing folder "%%f"
  9. %mysqldump% --host="localhost" --user=%dbUser% --password=%dbPassword% --port=%port% --single-transaction --add-drop-table --databases %%f > %backupDir%%dirName%%%f.sql
  10. %zip% a -tzip %backupDir%%dirName%%fileSuffix%_%%f . sql gz %backupDir%%dirName%%%f.sql`enter code here`
  11. del %backupDir%%dirName%%%f .sql
  12. )
  13. popd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement