Created
February 3, 2011 06:10
-
-
Save eurica/809110 to your computer and use it in GitHub Desktop.
My automated backup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@rem Simple recursive backup script [email protected] 2011 | |
@echo off | |
rem I strongly recommend backing up to a different drive or machine | |
set sourcedir=c:\projects | |
set destdir=g:\autobackups\projects | |
for /f "tokens=1-3 delims=/ " %%g in ('date /t') do ( | |
set mm=%%g | |
set dd=%%h | |
set yy=%%i | |
) | |
@echo on | |
xcopy %sourcedir% "%destdir%\backup-%yy%-%mm%" /V /E /D /C /I /Y > "%destdir%\lastbackup.txt" | |
@echo off | |
@rem XCOPY: Copies files and directory trees. | |
@rem /V Verifies the size of each new file. | |
@rem /D Copies only those files whose source time is newer than the destination time. | |
@rem /E Copies directories and subdirectories, including empty ones. | |
@rem /C Continues copying even if errors occur. | |
@rem /I Create destination if it deosn't exist | |
@rem /Y Suppresses prompting to confirm to overwrite |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Man, on point....