echo off d: cd d:\SITEBACKUP\BACKUPS @echo Post sync backup starting now... @echo Set the date variables up for the unique folder Set mm=%DATE:~3,2% Set dd=%DATE:~0,2% Set yyyy=%DATE:~6,10% set dmy=%yyyy%-%mm%-%dd% @echo Variables created. @echo Make the directories up for the nightly backup mkdir %dmy% cd %dmy% mkdir site mkdir db @echo Directories created. @Echo Backup the oxwall database, this will take a short while cd.. cd.. cd dbexport "c:\program files\mysql\mysqldump.exe" --host=YOURDATABASEHOST.COM -u YOURDBUSERNAME -pYOURDBUSERPASSWORD --databases YOURDATABASENAME > %dmy%.sql @echo Database dump created and downloaded. @echo copy the created sql to the backup folder copy *.sql d:\SITEBACKUP\backups\%dmy%\db @echo Database placed in temp folder. @echo Backup the site files, copy the site to the backup folder cd.. xcopy d:\SITEBACKUP\sync /e d:\SITEBACKUP\backups\%dmy%\site @echo Site files downloaded. @echo Archive the backup folder cd d:\SITEBACKUP\BACKUPS "c:\program files\winrar\rar.exe" a -ag %dmy%.zip d:\SITEBACKUP\backups\%dmy% @echo Database and files archived. copy *.zip d:\SITEARCHIVE cd.. rmdir /s /q backups mkdir backups @echo Remove the db cd dbexport del *.sql cd.. @echo finished, press any key to quit. sleep 30 exit