shell Backup using robocopy

@ECHO OFF
:: turn text output off

CD \Backup

SETLOCAL
:: variables to be local scope

SET _logfile="C:\Backup\%date%.log"

SET _what=/COPYALL /B /SEC /MIR
:: /COPYALL :: copy all file info
:: /B :: copy files in backup mode
:: /SEC :: copy files with SECurity
:: /MIR :: MIRror a directory tree

SET _options=/R:3 /W:1 /LOG+:%_logfile% /TS /FP /TEE /XJ /XA:SH /NP
:: /R:n :: number of Retries
:: /W:n :: Wait time between retries
:: /LOG :: Output log file (append)
:: /TS :: Include Source file Time Stamps in the output.
:: /FP :: Include Full Pathname of files in the output.
:: /TEE :: Output to console window, as well as the log file.
:: /ETA :: Show Estimated Time of Arrival of copied files.
:: /XJD :: exclude junction points
:: /XA:SH :: exclude hidden/system files
:: /NP :: No Progress (don't show % copied)

SET _source="D:\\Documents\"
SET _destination="Z:\Documents\\"
ROBOCOPY %_source% %_destination% %_what% %_options%

SET _source="D:\\Pictures\\"
SET _destination="Z:\Pictures\\"
ROBOCOPY %_source% %_destination% %_what% %_options%

SET _source="D:\\Web\\"
SET _destination="Z:\Web\\"
ROBOCOPY %_source% %_destination% %_what% %_options%

SET _source="D:\\Video\Ours\\"
SET _destination="Z:\Video\\"
ROBOCOPY %_source% %_destination% %_what% %_options%
This is the same script I use to backup my important data to an external HDD.

Updated: Tuesday 29th May 2012, 06:47pm

There are 0 comments

Leave a comment of your own

Comments are currently closed.