1 – Access Amazon Services, S3
2 – Create a New Bucket if there’s no one.
3 – Create credentials in IAM Amazon Services
4 – Download the tool s3.exe for windows, from s3.codeplex.com
5 – Create batch files for “mysqldump” and “s3.exe”
MySqlDump.bat sample:
[vb]
echo Running dump…
"C:\Program Files (x86)\MySQL\bin\mysqldump" –add-drop-table -uroot -pmyrootpasswd –result-file="C:\backup\_SQLDump\myDB_%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%_%TIME:~0,2%h%TIME:~3,2%.sql" mydbname
echo ok!
[/vb]
S3Put.bat sample:
[vb]
s3 auth myKey mySecret
s3 put mybucketname C:\backup\_SQLDump\myDB_*.sql /sync
[/vb]
6 – Schedule tasks for batch files, first MySqlDump.bat then S3Put.bat
[vb]
at \\mySevername 02:00 /every:M,T,W,Th,F,S,Su "C:\backup\MySqlDump.bat"
at \\mySevername 06:00 /every:M,T,W,Th,F,S,Su "C:\backup\S3Put.bat"
[/vb]
ok, it’s done 😉
s3.exe Documentation: http://s3.codeplex.com/documentation
How To Use the AT Command to Schedule Tasks: http://support.microsoft.com/kb/313565
Author: Carlos Galhano
Home