Archive for October, 2007

Simple WinRAR Backup Script for mySQL

net stop mysql
rar a -ag+YYYYMMDDHHMMSS- -rr -r -k -s -m0
      C:\BACKUPS\MYSQL-BACKUP.RAR C:\MYSQL\data
net start mysql

Save three lines as something.bat or autoexec.bat and then use it by Cron Jobs. Output file names like this :

20060808120000-MYSQL-BACKUP.RAR
20060808120001-MYSQL-BACKUP.RAR
20060808120002-MYSQL-BACKUP.RAR

( Before this you can update you path configuration. You can add a line at the end of PATH variable like this : C:\Program Files\WinRAR\ etc.)