Search This Blog

Tuesday, 2 October 2012

Quick dated copy of folder

A double click on the .bat file for a copy of the data in a dated folder

dobackup.bat


set stamp=%date:~6,4%%date:~3,2%%date:~0,2%_%time:~0,2%%time:~3,2%%time:~6,2%_bak
set source="c:\data"
set target=c:\data_backups\%stamp%
robocopy %source% %target% /XD temp /E > %target%.log


robocopy flags:
/XD  - exclude directory (in this case temp files that I don't want to backup)
/E  - copy (not mirror)

No comments:

Post a Comment