views:

37

answers:

3

I have WampServer 2.0 that is installed on Windows on my laptop.

I'm running on it an application that I wrote. The application is working with MySQL database.

I would like to make backups of this database periodically.

How this can be done ?

How could I define cron on Windows ?

A: 

Here's how to backup: http://www.ehow.com/how_5981373_do-up-mysql-database-wampserver2_.html

And here's how to schedule tasks: http://www.iopus.com/guides/winscheduler.htm

NOTE: On Vista/7, it's on the Administritative tools.

Ruel
That's a silly reason to -1.
Ruel
+1  A: 

You could use a bash script.

#!/bin/sh
mysqldump -uroot -ppwd --opt db1 > /sqldata/db1.sql
mysqldump -uroot -ppwd --opt db2 > /sqldata/db2.sql

cd /sqldata/
tar -zcvf sqldata.tgz *.sql
cd /scripts/
perl emailsql.pl

http://paulbradley.tv/38/

Michael Eakins
-1 He just mentioned, he's on windows. The word `Windows` was mentioned 4 times including in the tag.
Ruel
Additionally, you could check out: http://developedtraffic.com/2005/02/26/cron-and-database-backups/
Michael Eakins
With Cygwin A bash works in windows
Michael Eakins
Cygwin is not installed on Windows by default.
Ruel
My link shows you how to install CYGWIN!
Michael Eakins
+4  A: 

The rough equivalent of crontab -e for Windows is the at command, as in:

at 22:00 /every:M,T,W,Th,F C:\path\to\mysql\bin\mysqldump.exe ...

Running the at command by itself lists the tasks you've created using at.

The mysqldump documentation is here.

RichieHindle
+1 this is the best way.
Ruel
Thanks a lot !!
Misha Moroshko