@Echo On
REM Backup Batch Script for local production databases
REM *************************************************************
REM Phil Cotching, phil@pcconsulting.co.nz
REM December 2013
REM *************************************************************
@For /F "tokens=1,2,3,4 delims=/ " %%A in ('Date /t') do @(
Set DayW=%%A
Set Day=%%B
Set Month=%%C
Set Year=%%D
Set All=%%A-%%B-%%C-%%D
)
@For /F "tokens=1,2,3 delims=:,. " %%A in ('echo %time%') do @(
Set Hour=%%A
Set Min=%%B
Set Sec=%%C
Set Allm=%%A.%%B.%%C
)
@For /F "tokens=3 delims=: " %%A in ('time /t ') do @(
Set AMPM=%%A
)
osql -S WEB1\SQLEXPRESS -E -d master -Q"BACKUP DATABASE Kentico TO DISK='C:\Backup\Kentico-%All%_%Allm%%AMPM%bak' WITH INIT"
osql -S WEB1\SQLEXPRESS -E -d master -Q"BACKUP DATABASE KenticoCMS6 TO DISK='C:\Backup\KenticoCMS6-%All%_%Allm%%AMPM%bak' WITH INIT"
osql -S WEB1\SQLEXPRESS -E -d master -Q"BACKUP DATABASE KenticoCMS7-LiveSites TO DISK='C:\Backup\KenticoCMS7-LiveSites-%All%_%Allm%%AMPM%bak' WITH INIT"
cd c:\scripts