Monday, October 15, 2012

Automatic backup of moodle DB

I finally got around to setting this up on each of my *new moodle servers.  The bottom line, I am using mysqldump.exe to create backups of each of the DBs on my 3 moodle servers.  When I had the servers specked out, I choose a 80 gig hard drive partitioned as the F: drive, with the intention of storing the db backups on this drive, separate from the moodle application files and server software.  All of that is on the C: drive.  I am also storing the moodledata folder on the F: drive.

These are the steps completed on each server

1 - Created a DBBackup folder at the foot of the F: drive
2 - Copied the DBbackup.bat file into the DBBackup folder
3 - Created a scheduled task that would call the DBbackup.bat file

DBbackup.bat file:

@echo off
echo running dump...

C:\wamp\bin\mysql\mysql5.5.24\bin\mysqldump -u username -ppassword --result-file="f:\DBBackups\backupStudent.%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%.sql" name of db

C:\wamp\bin\mysql\mysql5.5.24\bin\mysqldump -u username -ppassword --result-file="f:\DBBackups\backupPD.%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%.sql" name of db

echo done...


Schedule task to call the DBbackup.bat file

AT 23:59 /EVERY:m,w,f f:\DBBackups\dbbackup.bat

These are the pages that helped me to work through this process.

The geek squad

Using command line AT Windows




No comments:

Post a Comment