-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBackupDocs.bat
More file actions
25 lines (21 loc) · 766 Bytes
/
BackupDocs.bat
File metadata and controls
25 lines (21 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@echo off
:: BackupDocs.bat - Backs up the Documents folder to a backup location.
:: --- CONFIGURATION ---
:: Set your source and destination folders here.
set "SOURCE=C:\Users\brigh\Documents"
set "DESTINATION=D:\Backups\Documents"
:: --- END CONFIGURATION ---
echo Starting backup of:
echo %SOURCE%
echo to:
echo %DESTINATION%
echo.
:: Robocopy flags:
:: /MIR :: MIRrors a directory tree (copies everything, deletes files in destination that no longer exist in source).
:: /R:2 :: Retries twice on a failed copy.
:: /W:5 :: Waits 5 seconds between retries.
:: /LOG:backup_log.txt :: Creates a log file of the operation.
robocopy "%SOURCE%" "%DESTINATION%" /MIR /R:2 /W:5 /LOG:backup_log.txt
echo.
echo Backup complete! See backup_log.txt for details.
pause