This script will copy files from the A side Server to teh B side server. It will only copy files that do not exist or are newer on the A side

: Gerard O'Rourke
: 20/08/2016
: Copy Audio Files from A to B side

@echo off
cls
echo =========== MEDIA FILES =============
echo.
echo *************************************
echo * Warning this file will copy files *
echo * from the A side to B side server  *
echo * Only Later Modified files will be *
echo * copied			    *
echo *************************************
echo.
echo =========== MEDIA FILES =============
echo.

set confirm=N
set /P confirm=Do you want to proceed and copy Media Files from A to B side (Y/N)?
if "%confirm%" == "Y" goto proceed
if "%confirm%" == "y" goto proceed
goto donotproceed

:donotproceed
echo.
echo File Copy aborted!!!
echo No files copied.
pause
exit

:proceed
echo.
echo Files Copied will be listed below
echo ---------------------------------
echo Reviewing files..
echo.

rem @echo on
XCOPY \\ucce-lab-cvp-1a\c$\inetpub\wwwroot\en-us \\ucce-lab-cvp-1b\c$\inetpub\wwwroot\en-us /S /D /Y
pause
: Gerard O'Rourke
: 20/08/2016
: Copy Audio Files from A to B side

@echo off

: Setting a Timestamp variable which can be used in a batch file


FOR /f "tokens=1-4 delims=/ " %%A IN ('date /t') DO (
set nday=%%A
set nmonth=%%B
set nyear=%%C
)
set SORTDATE=%nyear%%nmonth%%nday%

FOR /f "tokens=1-2 delims=: " %%A IN ('time /t') DO (
set hour=%%A
set min=%%B
)


set SORTTIME=%hour%%min%
set TIMESTAMP=%sortdate%-%sorttime%

cls
echo =========== MEDIA FILES =============
echo.
echo *************************************
echo * Warning this file will copy files *
echo * from the PRD to TST CVP servers   *
echo * Only Later Modified files will be *
echo * copied			    *
echo *************************************
echo.
echo =========== MEDIA FILES =============
echo.

set confirm=N
set /P confirm=Do you want to proceed and copy Media Files from A to B side (Y/N)?
if "%confirm%" == "Y" goto proceed
if "%confirm%" == "y" goto proceed
goto donotproceed

:donotproceed
echo.
echo File Copy aborted!!!
echo No files copied.
pause
exit

:proceed
echo.
echo Files Copied will be listed below
echo ---------------------------------
echo Reviewing files..
echo.

rem @echo on

REM set BACKUPFOLDER=C:\X-Backup\Media\%TIMESTAMP%
REM echo Backup Folder: %BACKUPFOLDER%
REM md %BACKUPFOLDER%

REM echo.
REM echo Ready For Backup?
REM pause
REM :backup
REM XCOPY C:\inetpub\wwwroot\en-us %BACKUPFOLDER% /S /Y

echo.
echo Ready to Copy Production WAV files?
pause

:copy from Production
XCOPY \\ucce-cvp-1a\c$\inetpub\wwwroot\en-us \\ucce-lab-cvp-1a\c$\inetpub\wwwroot\en-us /S /D /Y

:copy From A to B side
XCOPY \\ucce-lab-cvp-1a\c$\inetpub\wwwroot\en-us \\ucce-lab-cvp-1b\c$\inetpub\wwwroot\en-us /S /D /Y

echo Finished!
pause
  • tech-notes/scripts/copy-cvp-media.txt
  • Last modified: 2019/05/22 14:19
  • by gerardorourke