Home > Allgemein > Backup-Script mit RoboCopy

Backup-Script mit RoboCopy

Backup-Script mit RoboCopy

:START

SET RoboCopyPath=C:\Windows\System32\Robocopy.exe
SET SourceDir="C:\Users\Fidan.Jahiji.FIMA"
SET DestinationDir="P:\Temp"
SET LogFile=C:\log_bkp_DocsAndSettings.txt

REM See the robocopy documentation for what each command does.
REM /COPY:DAT :: COPY file data, attributes, and timestamps
REM /COPYALL :: COPY ALL file info
REM /B :: copy files in Backup mode.
REM /MIR :: MIRror a directory tree
REM /L :: Just list the info, don't actually do it

SET HowToCopy=/COPY:DAT

REM Exclude some files and directories that include transient data
REM that doesn't need to be copied.

SET ExcludeDirs=/XD "Temporary Internet Files" "Cache" "Recent" "Cookies" "iPod Photo Cache" "MachineKeys" "All Users" "Default User" "LocalService" "NetworkService" "Application Data" "Local Settings" "My Recent Documents" "NetHood" "PrintHood" "SendTo" "Templates"

SET ExcludedFiles=/XF *.bak *.tmp index.dat usrclass.dat* ntuser.dat* *.lock *.swp

REM Refer to the robocopy documentation for more details.
REM /R:n :: number of Retries
REM /W:n :: Wait time between retries
REM /LOG :: Output log file
REM /NFL :: No file logging
REM /NDL :: No dir logging
REM /E :: Include Empty Subdirectories
REM /XA:H :: Excludes files with hidden attribute
REM /XJ :: Exclude Junction Points (prevents recursive Application Data loop in Vista)

SET Options=/R:1 /W:1 /LOG+:%LogFile% /NFL /NDL /E /XJ

REM Execute the command based on all of our parameters
%RoboCopyPath% %SourceDir% %DestinationDir% %HowToCopy% %Options% %ExcludeDirs% %ExcludedFiles%

pause

:END

 

KategorienAllgemein
  1. Bisher keine Kommentare
  1. Bisher keine Trackbacks