E14– Windows Server Backup on DAG–Part1–Overview

 

1.

image

 

2. Separate batch for week days Mon, Wed & Fri/ Sun, Tue, Thu, Sat
image

 

3. Review the batch

echo off

For /f "tokens=1-3 delims=/ " %%a in ('date /t') do (set date=%%a-%%b-%%c)
For /f "tokens=1-2 delims=: " %%a in ('time /t') do (set time=%%a:%%b)


rem echo The date is %date%
rem echo The time is %time%

Rem ==================================
PowerShell.exe -command ". C:\Batch\WSB\PS_RedistributeActiveDatabase_before-WSB.ps1"

Rem ==================================
Cscript C:\Batch\WSB\DB_Active_Notify.vbs

Rem ==================================
del  "C:\Batch\WSB\DB_Activation_Log\DB_Activation.txt"


Timeout /T 100

Rem ==================================
Rem ==================================
set backuplog="c:\batch\WSB\BackupLog\"%computername%-WSB.txt""

echo. Start:%date%  %time%  >> %backuplog%
echo. ================================== >> %backuplog%

Rem ==================================

rem pause
wbadmin start backup  -backupTarget:B: -include:P:,S:,T:,U:,V:,W:  -vssFull -quiet >> %backuplog%


Rem ==================================
echo. ================================== >> %backuplog%

For /f "tokens=1-3 delims=/ " %%a in ('date /t') do (set date=%%a-%%b-%%c)
For /f "tokens=1-2 delims=: " %%a in ('time /t') do (set time=%%a:%%b)

echo. Start:%date%  %time%  >> %backuplog%
echo. ================================== >> %backuplog%


Rem ==================================
cscript C:\Batch\WSB\Backupnotify.vbs

Rem ==================================
copy "c:\batch\WSB\BackupLog\"%computername%-WSB.txt"" "c:\batch\WSB\BackupLog\"%computername%-WSB_%date%.txt"" /Y
del  "c:\batch\WSB\BackupLog\"%computername%-WSB.txt""

Comments

Popular posts from this blog

E15 CU3–Update Failed–AD replicated Exceeded the tombstone lifetime.

202301 - Exchange onpreme - PowerShell Serialization Payload Signing

Ticket: RemoteAPP certificate revocation check error