Utiliser Robocopy pour une sauvegarde

Ou couramment dit “backup” Smile

 

Dans le cas précis d’un backup, j’utilise juste un paramètre en plus “/MIR” qui me permet d’avoir à l’identitique mon répertoire destination avec mon répertoire source.

Comme cela, si je supprime des fichiers de mon disque local, ils seront aussi supprimés de mon backup ! 

REM SOURCE is only the drive letter REM FOLDER is the local subfolder to backup

REM DESTINATION is the folder on the USB direve where I backup all my folders REM optional LOG file

 

SET FILE=*.* SET SOURCE=S:\ SET DESTINATION=D:\sbovoBackup

 

REM ------------------   Sauvegarde Dev ------------------ SET FOLDER=Dev SET SRC=%SOURCE%\%FOLDER% SET DEST=%DESTINATION%\%FOLDER% robocopy  "%SRC%" "%DEST%" "%FILE%" /MIR /Z /E /XJ  /MT

REM ------------------   Sauvegarde Personal ------------------ SET FOLDER=Personal SET SRC=%SOURCE%\%FOLDER% SET DEST=%DESTINATION%\%FOLDER% robocopy  "%SRC%" "%DEST%" "%FILE%" /MIR /Z /E /XJ  /MT

REM ------------------   Sauvegarde PFE ------------------ SET FOLDER=PFE SET SRC=%SOURCE%\%FOLDER% SET DEST=%DESTINATION%\%FOLDER% robocopy  "%SRC%" "%DEST%" "%FILE%" /MIR /Z /E /XJ  /MT

 

REM etc...............................................

 

A bientôt,

Sebastien.