|
Personal backups using ROBOCOPY (Win7)
You must already know how to use batch commands to use this page. I accept For daily backups of personal files, I use a batch program (command files). For important files, I use the free Dropbox file service to make a copy in the cloud as well as making them available on all my devices. (My network drive's backup software creates constant overhead on my network every time there is a change in my files.) A Windows-7 program called ROBOCOPY is designed to copy files from a specified source folders and overwrite them in the destination folder if the time stamp or file size is different. If you put Robocopy commands in a Batch Program, you can run it whenver you wish, or create a 'task' using the Windows Task Scheduler to run it at the same time every day. Creating your backup program: Using a dated Log File: Testing: TemplateSome lines display as 2 lines but must be typed as one. Test carefully after eash PAUSE command. Only remove the PAUSE commands after the batch program is thoroughly tested. The log file will show which files were checked and which were actually copied.
@echo off
ECHO BackupMyFiles.bat - using Robocopy REM____TODAY'S DATE____ for /F "delims=/ " %%i in ('date /t') do (set Date=%%i) REM____LOG FILE LOCATION____ set LOG=F:\Backups\Logs\%Date%.log REM____USER FOLDERS LOCATION____ set USER=C:\Users\_LOGIN_NAME_ REM____BACKUP LOCATION____ set DEST="F:\Backups" REM____PROGRAM LOCATION (check)____ set APP=C:\Windows\System32\Robocopy.exe REM____COPY OPTIONS (one line)____ set OPT=/COPY:DT /E /FFT /FP /R:0 /XA:H /MT /NC /NP /NS /XA:H /XJ /S /W:3 /XF *.tmp /XD old /LOG+:%log% REM____MIRROR OPTIONS____ set MIRROR=/MIR /R:0 /XA:H /MT /NS /NC /XJ /LOG+:%log% REM____START/APPEND LOG FILE (one line)____ ECHO ##### ROBOCOPY Backup to %DEST% on %Date% ##### >> %LOG% ECHO. >> %LOG% REM____BACKUP USER FOLDERS except AppData____ %APP% %USER% %DEST%\UserData %OPT% /XD AppData PAUSE REM____BACKUP OTHER FOLDERS____ REM____Insert commands for your folders here: REM %APP% "D:\My Files" "%DEST%\My Files" %OPT% REM %APP% "G:\Photos" %DEST%\Photos %OPT% PAUSE REM____MIRROR Start Menu (one line)____ %APP% "%USER%\AppData\Roaming\Microsoft\Windows\Start Menu" %DEST%\Start_Menu %MIRROR% PAUSE ECHO. >> %LOG% ECHO ================================================ >> %LOG% ECHO. >> %LOG% ECHO. ECHO Done. PAUSE EXIT ROBOCOPY SWITCHESOpen a command prompt (Start > Run > "cmd") and type the following command to view all Robocopy documentation (in pages):
Here are some Robocopy switches with their explanations.
** The option /M should save time by only backing up new or updated files in the source folder rather than comparing all the files in the source to the destination folders across the network. I have not tested this theory, but I use this option in my own backup script. To learn more about Batch Programs, open the Windows Help System (Start > Help or F1 key) and type this: Hint: If your Start Menu does not contain a Run command, right click on the taskbar (bottom of screen) and select Properties. Click the Start Menu tab, then Customize. Select the item to display the Run command. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The PDQ Library is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
|