Using XCOPY Command for Backup

Objective

Recently, my colleague lost his data as he did not do regular backup.  Suddenly, it remind me that I should also do some regular backup both at my workplace and my home pc.

Frankly, I am lazy to do daily backup, so I have to think of some ways to do daily backup.

Steps

1) Use the XCOPY command that comes with Windows

2) Use Notepad to create a file naming it as mybackup.bat

Contents for mybackup.bat (assuming that f: drive is my portable harddisk which is always plug into my computer)
xcopy /S /Y /I /D c:\myfolder1 f:\myfolder1
xcopy /S /Y /I /D c:\myfolder2 f:\myfolder2

(you can copy and paste to as many folders that you like to backup)

Save it in any of your C: folder.

Create a short cut to Desktop (right click the file mybackup.bat and send to desktop)

Double click to test it (check whether the files are backup in your USB portable harddisk).

3) Use the Windows Task Scheduler and create a task to schedule it at time when you are likely to power on your computer.

Start -> Programs -> Accessories - System Tools -> Task Scheduler

Conclusion

Finally, daily backup of my important c: drive folders automatically to my portable harddisk.

XCOPY command notes

/S : Copies directories and subdirectories, unless they are empty. If you omit /s, xcopy works within a single directory.

/Y : Suppresses prompting to confirm that you want to overwrite an existing destination file. 

/I : If Source is a directory or contains wildcards and Destination does not exist, xcopy assumes destination specifies a directory name and creates a new directory. Then, xcopy copies all specified files into the new directory. By default, xcopy prompts you to specify whether Destination is a file or a directory. 

/D [:mm-dd-yyyy] : Copies source files changed on or after the specified date only. If you do not include a mm-dd-yyyy value, xcopy copies all Source files that are newer than existing Destination files. This command-line option allows you to update files that have changed. 

Back To:
GoToThings - Knowledge Sharing

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity. Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
The content on this site may not be reproduced or redistributed without the express written permission of 
 www.gotothings.com or the content authors.