I wrote this to perform nightly backups on a windows server. Just put in a .BAT file and schedule it whenever.
It works well for me on a couple of MS servers. If anyone can make modifications, please post back.
-------------------------------------------------------------
REM MySQL backup script
REM Enter the path to where you want the backup data to go
set backupdir=E:\SQLData\MySQLbackup
REM Enter the path to your MySQL binaries (where mysqldump is)
set dump=E:\MYSQL\bin
if exist %backupdir%\*8.sql del %backupdir%\*_8.sql
if exist %backupdir%\*7.sql ren %backupdir%\*_7.sql* *_8.sql
if exist %backupdir%\*6.sql ren %backupdir%\*_6.sql* *_7.sql
if exist %backupdir%\*5.sql ren %backupdir%\*_5.sql* *_6.sql
if exist %backupdir%\*4.sql ren %backupdir%\*_4.sql* *_5.sql
if exist %backupdir%\*3.sql ren %backupdir%\*_3.sql* *_4.sql
if exist %backupdir%\*2.sql ren %backupdir%\*_2.sql* *_3.sql
if exist %backupdir%\*1.sql ren %backupdir%\*_1.sql* *_2.sql
%dump%\mysqldump --all-databases > %backupdir%\mysqlbackup_1.sql
It works well for me on a couple of MS servers. If anyone can make modifications, please post back.
-------------------------------------------------------------
REM MySQL backup script
REM Enter the path to where you want the backup data to go
set backupdir=E:\SQLData\MySQLbackup
REM Enter the path to your MySQL binaries (where mysqldump is)
set dump=E:\MYSQL\bin
if exist %backupdir%\*8.sql del %backupdir%\*_8.sql
if exist %backupdir%\*7.sql ren %backupdir%\*_7.sql* *_8.sql
if exist %backupdir%\*6.sql ren %backupdir%\*_6.sql* *_7.sql
if exist %backupdir%\*5.sql ren %backupdir%\*_5.sql* *_6.sql
if exist %backupdir%\*4.sql ren %backupdir%\*_4.sql* *_5.sql
if exist %backupdir%\*3.sql ren %backupdir%\*_3.sql* *_4.sql
if exist %backupdir%\*2.sql ren %backupdir%\*_2.sql* *_3.sql
if exist %backupdir%\*1.sql ren %backupdir%\*_1.sql* *_2.sql
%dump%\mysqldump --all-databases > %backupdir%\mysqlbackup_1.sql