12 lines
581 B
Batchfile
12 lines
581 B
Batchfile
@echo off
|
|
rem LosaDev 2014: restore.bat <stamp> [folder] [server] stamp = yyyyMMdd_HHmm of the backup files
|
|
rem Stop every game server first. The three databases are replaced.
|
|
setlocal
|
|
if "%~1"=="" echo Usage: restore.bat ^<yyyyMMdd_HHmm^> [folder] [server] & exit /b 1
|
|
set DIR=%~2
|
|
if "%DIR%"=="" set DIR=D:\LosaBackup
|
|
set SRV=%~3
|
|
if "%SRV%"=="" set SRV=.\SQLEXPRESS
|
|
choice /m "Replace LosaGame, LosaGame_log, LosaLogData and Backup on %SRV% with the %~1 backup"
|
|
if errorlevel 2 exit /b 1
|
|
sqlcmd -S "%SRV%" -E -b -v BACKUP_DIR="%DIR%" STAMP="%~1" -i "%~dp0restore.sql" |