Robocopy for backup purposes.

View previous topic View next topic Go down

Robocopy for backup purposes.

Post  MHolmes on Tue Feb 01, 2011 2:00 pm

For purposes of backup.

The following script will make a complete copy of the current target and copy it to the destination. I used this script for backup up file from a PC to external, especially at home.

If using windows Vista or 7 Robocopy is already a part of your system, otherwise if using server 2003 or windows XP you will need to download and install the 2003 resource kit. Server 2003 resource kit

open up notepad and paste in the following text between the ---- lines. Change "C:\sourceFolder" and "V:\DestinationFolder" to appropriate folder locations. The folder does not have to exist on the destination drive. The script will create the folder and all folder structure below on the destination drive. Then save the file as Backup.cmd(make sure you do not also have .txt on the end. Otherwise save as backup.txt and then find the file and change it to .cmd. It will ask if you are sure you want to change the file type, this is ok to do.

----------------------------
@echo OFF
C:\Windows\System32\ROBOCOPY C:\sourceFolder\ V:\DestinationFolder\ /MT /PURGE /XO /E /XD "_RESTORE" "MSOCache" "Recycled" "RECYCLER" "Temporary Internet Files" "System Volume Information"

Goto Done
:Done
Echo Done
Pause

Stop
---------------------
After you have your script created, double click it and let it backup your files.

This script will only copy files that have changed, so after you run it once, future running of this script will be much quicker. If you delete files on the source the script will also delete the files from the destination when the script is run. Again this script is to create a complete backup of the source on the destination including deletions of files from the source. This process is great for creating backups of your music, pictures, movies, or etc to an external usb drive. Given that external usb drive prices have fallen drastically, this is something everyone should do if they deem their home files important what so ever.
avatar
MHolmes
Admin

Posts : 14
Join date : 2011-01-11
Age : 34
Location : Omaha, NE

View user profile http://omahaitcoalition.forumotion.com

Back to top Go down

Re: Robocopy for backup purposes.

Post  MHolmes on Tue Feb 01, 2011 2:06 pm

You can dupicate the

C:\Windows\System32\ROBOCOPY C:\sourceFolder\ V:\DestinationFolder\ /MT /PURGE /XO /E /XD "_RESTORE" "MSOCache" "Recycled" "RECYCLER" "Temporary Internet Files" "System Volume Information"

line as many times as you want for backing up multiple folders to differing locations.
avatar
MHolmes
Admin

Posts : 14
Join date : 2011-01-11
Age : 34
Location : Omaha, NE

View user profile http://omahaitcoalition.forumotion.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum