@ECHO OFF
SETLOCAL
::******************************************* Constants / ROBOCOPY Settings ***********************************************************
SET _what=/COPYALL /E
:: /COPYALL :: COPY ALL file info
:: /B :: copy files in Backup mode.
:: /SEC :: copy files with SECurity
:: /MIR :: MIRror a directory tree
:: /E :: Copy Subfolders, including Empty Subfolders.
SET _options=/R:0 /W:0 /TS /FP /IS
:: /R:n :: number of Retries
:: /W:n :: Wait time between retries
:: /LOG :: Output log file
:: /NFL :: No file logging
:: /NDL :: No dir logging
:: /IS :: Include Same, overwrite files even if they are already the same. Use this options if you want to overwrite
:: /XO :: eXclude Older - if destination file exists and is the same date or newer than the source - don't bother to overwrite it.
SET _timestamp=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%%TIME:~0,2%%TIME:~3,2%
:: This will create a timestamp like yyyymmyyhhmm.
SET _source="X:\source\Deployment\Deploy Me"
:: Source of the files to copy from
::*************************************** End of Constants / ROBOCOPY Settings ********************************************************
:: Delivery 1
SET _dev1="\\delivery1\c$\inetpub\dev.website.com\Website"
SEt _dev1log="X:\delivery1\Deployment\Deployment Logs\APP01"\%_timestamp%.txt
Echo Synchronising Delivery Server 1 with CMS Server
ROBOCOPY %_source% %_dev1% %_what% %_options% /LOG:%_dev1log%
Echo Synchronising to Delivery Server 1 has been completed!
:: End of Delivery 1
Echo.
:: Delivery 2
SET _dev2="\\delivery2\c$\inetpub\dev.website.com\Website"
SEt _dev2log="X:\delivery2\Deployment\Deployment Logs\APP02"\%_timestamp%.txt
Echo Synchronising Delivery Server 2 with CMS Server
ROBOCOPY %_source% %_dev2% %_what% %_options% /LOG:%_dev2log%
Echo Synchronising to Delivery Server 2 has been completed!
:: End of Delivery 2
::***************************************** Archive Settings **************************************************************************
SET _archiveDest="X:\Some Folder\Deployment\Archive"\%_timestamp%
SEt _archivelog="X:\Some Folder\Deployment\Archive\Logs"\%_timestamp%.txt
SET _ArchiveWhat=/MOVE /E /COPYALL
:: /COPYALL :: COPY ALL file info
:: /B :: copy files in Backup mode.
:: /SEC :: copy files with SECurity
:: /MIR :: MIRror a directory tree
:: /E :: Copy Subfolders, including Empty Subfolders.
SET _ArchiveOptions=/R:0 /W:0 /XO /LOG:%_archivelog%
:: /R:n :: number of Retries
:: /W:n :: Wait time between retries
:: /LOG :: Output log file
:: /NFL :: No file logging
:: /NDL :: No dir logging
:: /IS :: Include Same, overwrite files even if they are already the same. Use this options if you want to overwrite
:: /XO :: eXclude Older - if destination file exists and is the same date or newer than the source - don't bother to overwrite it.
::************************************** End of Archive Settings **********************************************************************
Echo.
Echo Archiving "Deploy Me" folder
ROBOCOPY %_source% %_archiveDest% %_ArchiveWhat% %_ArchiveOptions%
md "X:\Some Folder\Deployment\Deploy Me"
Echo Archive complete!
pause
No comments:
Post a Comment