@echo off REM this script copies your home directory on your local Windows machine: REM %HOMEDRIVE%%HOMEPATH% REM to a special directory on your H: drive: REM H:\BACKUP\%COMPUTERNAME% REM and keeps a logfile of that backup in that same directory: REM H:\BACKUP\%COMPUTERNAME%.log REM this script can be used with or without the optional argument /l REM use that argument to list but not actually copy REM some local files and directories are not copied because they only contain REM cache and other temporary data - this speeds up the backup a lot ;-) robocopy %HOMEDRIVE%%HOMEPATH% H:\BACKUP\%COMPUTERNAME% %1 /MIR /R:0 /NP /NDL /FFT /DST /XJ /LOG:H:\BACKUP\%COMPUTERNAME%.log /TEE /XD "%HOMEDRIVE%%HOMEPATH%\AppData\Local\Google\Chrome\User Data\Default\Cache" "%HOMEDRIVE%%HOMEPATH%\AppData\Local\Google\Chrome\User Data\Default\Media Cache" "%HOMEDRIVE%%HOMEPATH%\AppData\Local\Google\Chrome\Application" "%HOMEDRIVE%%HOMEPATH%\AppData\Local\Google\Update" "%HOMEDRIVE%%HOMEPATH%\AppData\Local\Microsoft\Windows\Temporary Internet Files" "%HOMEDRIVE%%HOMEPATH%\PortApps\PortableApps\FirefoxPortable\Data\profile\mozilla-media-cache" "%HOMEDRIVE%%HOMEPATH%\PortApps\PortableApps\ThunderbirdPortable\Data\profile\Cache" pause REM Some more explanation: REM xcopy does not work well because there are no options like /FFT and /DST REM and therefore too much is copied on each run REM /FFT (and probably /DST) are necessary to cope with the subtle differences REM in the way NTFS and ext[34] handle time ;-) REM /XJ is needed to avoid copying the virtual directories like My (Documents|Music|...)