Goal – Incremental backup by the day so we can find the version of the file(s) we prefer.
For this backup we will use xcopy to copy files and folders that have changed since the last incremental backup. This type of backup is useful if you are not sure WHEN the file you are looking for was deleted or damaged. Incremental backups allow you to open the file as it existed yesterday, the day before, two days before, etc. In this example we will save the last ten days. Incremental backups are small as they only include information changed since the last backup.
For the script example, we are interested in two folders:
• Source – \\server\data
• Destination – e:\backup\inc
Here is the example script:
rem ---------------- deletes oldest backup rd /s/q e:\backup\inc9 rem ---------------- rename old backups rename e:\backup\inc8 inc9 rename e:\backup\inc7 inc8 rename e:\backup\inc6 inc7 rename e:\backup\inc5 inc6 rename e:\backup\inc4 inc5 rename e:\backup\inc3 inc4 rename e:\backup\inc2 inc3 rename e:\backup\inc inc2 rem ---------------- copies changed data xcopy /c/h/s/v/m \\server\data e:\backup\inc