The first thing to do is to create a folder to hold your backups. I created a folder in the root of the c:\ drive
Step 2: Create a Backup Script Batch File
Open Notepad, and copy/paste the script below into it:
REM Rock's quick database backup scriptThe first line above simply sets the path to the mysqldump command (change to your path)
REM Place this batch file into Microsoft Scheduler, set to daily
mysqldump --opt -uroot -pxxxxx opensim > c:\OpensimDatabaseBackup\opensim.sql
ren opensim.sql "%date:~10,4%-%date:~4,2%-%date:~7,2%.sql"
The second line issues the mysqldump command, the --opt switch makes the backup clean, (change root and the xxxxx for your own user name and password)
The third line changes to the folder where you will be saving the backups (the folder in Step 1)
The fourth line renames opensim.sql to today's date, eg 2008-12-16.sql
Save this script as OpensimBackup.bat
(you can save it wherever you like, but remember its location))
Step 3: Create a Windows Scheduler Task
Go into the Control Panel and select 'Scheduled Tasks'
Choose 'Add Scheduled Task' to start the wizard
Choose the program you want to run (OpensimBackup.bat), Daily, and set the time
Supply the Administrator Password if you are not logged in with Adminstrator privileges.
Click on Finish
Go into Control Panel, Administrative Tools, Task Scheduler
Choose Action from the menu, and Create Basic Task
Give the Task a Name: such as Daily Opensim MySQL Backup
Give a Description (optional)
Set the Frequency to Daily
Set the Time (I made mine at 4am in the morning)
Choose the Program to run (OpensimBackup.bat)
Choose to Display Properties when Finished
In the Properties dialog, General Tab, ensure that 'Run whether user is logged on or not' is selected.
On the Settings Tab, ensure that 'Stop the task if it runs longer than' is set to 1 hour.
Hopefully, this should cure your (OMG, what has happened to my database) blues.