This script requires your date and time formats to be the windows default formats. Changing them can break this script. The script pauses at the end to cause a cmd window to remain open for long enough for the user to read the output.
@echo off echo Starting Backup of Database: %1 For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set dt=%%c-%%a-%%b) For /f "tokens=1-4 delims=:." %%a in ('echo %time%') do (set tm=%%a%%b%%c%%d) set bkupfilename=%1 %dt% %tm%.bak echo Backing up to file: %bkupfilename% mysqldump %1 --routines -u %2 -p%3 > "%bkupfilename%" echo Backup Complete! pause echo on
--
Version 0.1.0 - 2006-03-13
STEM: The STEM Cells of PHP
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License
http://creativecommons.org/licenses/by-sa/2.5/