Incremental backup of data with .BAT (Batch)
Use of incremental back up
Incremental back up can be used to save your important data before you format your computer.
During the first batch launch, all the files and folders are saved and when relaunched after 2-3 weeks, all the changes made are saved.
As for the above given example, the files are saved at the root C under the partition D in the back up file and favorites
("% USERPROFILE%" is the variable of "Documents and Settings \ username").The switches:
E / H / R / Y / I / D, are used to copy the system hidden files ,.... For more information, open the command prompt (cmd.exe) and type xcopy/?
Example
First of all, open the notepad and copy:
@echo off
xcopy C:\Docs D:\Backup\Docs /E /H /R /Y /I /D
xcopy "%USERPROFILE%"\Favoris D:\Backup\Favoris /E /H /R /Y /I /D
pause
Then click on
File >
Save as > name the file extension as
name.bat( the name is optional) and select file type as
all files.
Launch the file to copy the data from
C to D.
Note: Depending on your needs, you can change the letter of drives in the script.