I have come up with a fairly slick daily offsite backup solution when using WAMP, or windows based apache mysql.
Here is the batch file obviously you will replace the source and destination paths and the database username , password and database name : FYI The password is contained within quotes. EDIT: also you will need to correct the path to your mysqldump file.
copy and paste in notepad and save as .bat file. run it manually, once you find it is working you can create a scheduled task to run the batch file as often as you would like.
FYI: the xcopy is a sync, so any file that is newer, or new in the source will be overwritten in the destination path... you probably could just do this for the attachments if you aren't making any code changes, but I had 5MB to spare...
How it works for me though is I have everything exporting to a google drive folder which immediately syncs to my google drive account anytime any changes are made, probably coudl do the same with drop box, but now I have 5GBs... Once in a while I will have to manually purge the old .sql files
Code: Select all
REM @echo off
for /f "tokens=1" %%i in ('date /t') do set DATE_DOW=%%i
for /f "tokens=2" %%i in ('date /t') do set DATE_DAY=%%i
for /f %%i in ('echo %date_day:/=-%') do set DATE_DAY=%%i
for /f %%i in ('time /t') do set DATE_TIME=%%i
for /f %%i in ('echo %date_time::=-%') do set DATE_TIME=%%i
"C:\wamp\bin\mysql\mysql5.5.16\bin\mysqldump" -u username -p"password" databasename >"E:\Hesk Backup\Google Drive\database\%DATE_DAY%_%DATE_TIME%_hesk.sql"
xcopy C:\wamp\www "E:\Hesk Backup\Google Drive\website files\www" /D /E /Y