Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: Released under the GNU General Public License version 3 by J2897.
- :: This script will create an exact mirror of the files in the SOURCE folders in the DESTINATION folders. The timestamps will be preserved. The security permissions will be disgarded.
- :: WARNING: Anything that has been deleted from the SOURCE will be automatically deleted from the DESTINATION. So be careful!
- :: Note: If you don't want files to be automatically deleted from the DESTINATION folders, use the Copy script instead: http://pastebin.com/mZYjpT1S
- @echo OFF
- REM Custom variables.
- set "TASKNAME=Mirror again"
- set "SOURCE=\\NAS1\FreeNAS"
- set "DESTDRIVE=J:"
- set "DESTINATION=%DESTDRIVE%\NAS1\FreeNAS"
- REM Fixed variables.
- set "LOGFOLDER=%USERPROFILE%\RoboCopy Logs"
- set "LOGFILE=%LOGFOLDER%\%TASKNAME%.log"
- set "TAB= "
- REM Preparation.
- title %TASKNAME%
- pushd "%~dp0"
- if not exist "%LOGFOLDER%" (md "%LOGFOLDER%")
- REM Display.
- echo Mirroring . . .
- echo.
- echo SOURCE:%TAB%%TAB%%SOURCE%
- echo DESTINATION:%TAB%%DESTINATION%
- REM Main Robocopy command.
- robocopy.exe "%SOURCE%" "%DESTINATION%" *.* /MIR /NP /R:100 /W:30 /Z /LOG:"%LOGFILE%" /XJ /XD "%DESTDRIVE%\$RECYCLE.BIN" "%DESTDRIVE%\System Volume Information" /XF "desktop.ini"
- REM Finish up.
- explorer /select,"%LOGFILE%"
- popd
- echo.
- pause
- :End
- echo.
- echo Ending . . .
- timeout /t 4 /nobreak >nul
- exit /b 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement