Wednesday, June 8, 2011

Robocopy backups

C:\>robocopy c:\users\joe\documents e:\backup /copyall /mir /r:0 /w:0 /log:c:\users\joe\desktop\robocopy.log

I wasn't sure about including robocopy here, because it's not built in to XP, but it comes with Windows 7 (and I think Vista too). You can download it for XP from the Windows Server 2003 Resource kit here. This particular command will back up Joe's documents folder to a folder called "backup" on the E: drive, presumably a USB drive.

It will (/copyall) copy all NTFS rights (irrelevant on a FAT32-formatted flash drive), it will (/mir) mirror content, meaning it will only back up changed files or files with newer time stamps, but it will also delete* any files not existing on the source. It will not (/r:0 /w:0) retry failures, and it will create a log of everything on the desktop.

*Be VERY careful with the /mir switch. The FIRST thing it does is delete folders that don't exist on the source. So if you accidentally point it at the root of your external drive instead of the backup folder, it will wipe it out before you have a chance to stop it.

1 comment: