Robocopy Backup Routine for you Windows Sysadmins

This creates a total of 20 copies of c:\shared to d:\backup. I run it daily.

d:
cd backup
rmdir /s /q dailynew20
rename dailynew19 dailynew20
rename dailynew18 dailynew19
rename dailynew17 dailynew18
rename dailynew16 dailynew17
rename dailynew15 dailynew16
rename dailynew14 dailynew15
rename dailynew13 dailynew14
rename dailynew12 dailynew13
rename dailynew11 dailynew12
rename dailynew10 dailynew11
rename dailynew9 dailynew10
rename dailynew8 dailynew9
rename dailynew7 dailynew8
rename dailynew6 dailynew7
rename dailynew5 dailynew6
rename dailynew4 dailynew5
rename dailynew3 dailynew4
rename dailynew2 dailynew3
rename dailynew1 dailynew2
rename dailynew dailynew1

robocopy c:\shared d:\backup\dailynew\ /s /r:1 /w:1

Leave a Reply

Your email address will not be published. Required fields are marked *