Personel backup data with robocopy

Create an autobat file and add to your window schedule then let it auto run with logging:

@echo off

set dateStamp=%DATE:~-4%%DATE:~4,2%%DATE:~7,2%
set scriptPath=C:\roboBackup
set logPath=C:\roboBackup\log
set backupSource=D:\Data
set backupDestination=”\\backup\phong\BACKUP”

@REM *** START: Turns logging on ***
if “%~1” == “NOWLOGGING” goto NowLogging
set SchedulesLogFile=%logPath%\%~n0 – %date:/=-%.txt
%0 “NOWLOGGING” > “%SchedulesLogFile%” 2>&1
rem Disable logging by uncomment below line
rem goto :EOF


@REM *** END: Turns logging on ***

@rem Guts of batch file…
echo [%date% %time%] starting…
echo *** start of actual batch file…

robocopy %backupSource%\CompanyData %backupDestination%\CompanyData /E /MIR /XJ /XD .svn /R:2 /W:5 /NDL /NP /LOG:”%logPath%\log.bk-CADENA-%dateStamp%.txt”
@rem Stop Outlook before backup mail data pst file
taskkill /im outlook.exe
timeout /t 10 /nobreak
robocopy %backupSource%\Mail %backupDestination%\Mail /XO /E /XJ /R:2 /W:5 /NDL /NP /LOG:”%logPath%\log.bk-Mail.%dateStamp%.txt”

echo *** end of batch file…
echo [%date% %time%] ending…