Welcome to The Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads

if anybody needs help backing up files


bort
 Share

Recommended Posts

windows vista/7/server2008 comes with a program called "robocopy" instead of "xcopy" in previous versions of windows for its main filecopy program. For instance, when you tell Explorer to copy files, you're actually using robocopy "under-the-hood" so to speak.

 

Robocopy is a "Robust file Copy" utility that is very customizable in terms of execution under the command line. You can set flags for what files to copy, what attributes or security information to copy, how to copy them, etc. The best part about robocopy is that it does not waste time, resources, or hard drive activity re-copying files which are already backed up, or which have not changed since last time the were backed up.

 

windows XP & server2003 don't come with it, but you can DL & install it for free from here:

http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

(it's a component of Windows Server 2003 Resource Kit Tools)

 

You can use it to set up a batch file to mirror a source to a destination.

 

Example batch file for vista/7/server2008:

C:\backup\backup.bat

@echo off
cls

REM Set general Robocopy flags...
set flags=/mir /xo /R:0 /NP /TEE

REM ======================================
REM Backup the 'Desktop' folder...
REM --------------------------------------
set log=/LOG:"C:\backup\robcopylog_desktop.txt"
set source="C:\Users\my_user_name\Desktop"
set dest="\\my_shared_network_folder\backups\desktop"
ROBOCOPY %source% %dest% %flags% %log%
REM ======================================

REM The script will now exit

 

Feel free to backup more folders by copy/pasting the section between the lines (======) and modifying the source, dest, & log flags.

 

Example batch file for XP/2000/server2003: (you need to first install robocopy from MS's site like I mentioned above)

C:\backup\backup.bat

@echo off
cls
setlocal
cd\
cd "C:\Program Files\Windows Resource Kits\Tools"

REM Set general Robocopy flags...
set flags=/mir /xo /R:0 /NP /TEE

REM ======================================
REM Backup the 'Desktop' folder...
REM --------------------------------------
set log=/LOG:"C:\backup\robcopylog_desktop.txt"
set source="C:\Documents and Settings\my_user_name\Desktop"
set dest="\\my_shared_network_folder\backups\desktop"
ROBOCOPY %source% %dest% %flags% %log%
REM ======================================

REM The script will now exit

 

Now you can use Scheduled Tasks (found in Control Panel of windows) to set up a re-occuring execution of this batch file on a daily or weekly basis, or whatever suits your needs. Or just double-click the batch file to run the backup only when you want.

 

The behavior of robocopy is very customizable. The current copy flags will ensure that the destination folder matches the source folder exactly:

  • Any files that exist in the source folder only will be copied to the dest folder
  • Any files that exist in the dest folder but not in the source folder will be deleted from the dest
  • It won't waste time mirroring files that already exist (it will only mirror new or changed files)

 

List of robocopy flags can be found here as well as several other places online if you google it:

http://www.xxcopy.com/xxcopy30.htm

Link to comment
Share on other sites

windows vista/7/server2008 comes with a program called "robocopy" instead of "xcopy" in previous versions of windows for its main filecopy program. For instance, when you tell Explorer to copy files, you're actually using robocopy "under-the-hood" so to speak.

 

Robocopy is a "Robust file Copy" utility that is very customizable in terms of execution under the command line. You can set flags for what files to copy, what attributes or security information to copy, how to copy them, etc. The best part about robocopy is that it does not waste time, resources, or hard drive activity re-copying files which are already backed up, or which have not changed since last time the were backed up.

 

windows XP & server2003 don't come with it, but you can DL & install it for free from here:

http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

(it's a component of Windows Server 2003 Resource Kit Tools)

 

You can use it to set up a batch file to mirror a source to a destination.

 

Example batch file for vista/7/server2008:

C:\backup\backup.bat

@echo off
cls

REM Set general Robocopy flags...
set flags=/mir /xo /R:0 /NP /TEE

REM ======================================
REM Backup the 'Desktop' folder...
REM --------------------------------------
set log=/LOG:"C:\backup\robcopylog_desktop.txt"
set source="C:\Users\my_user_name\Desktop"
set dest="\\my_shared_network_folder\backups\desktop"
ROBOCOPY %source% %dest% %flags% %log%
REM ======================================

REM The script will now exit

 

Feel free to backup more folders by copy/pasting the section between the lines (======) and modifying the source, dest, & log flags.

 

Example batch file for XP/2000/server2003: (you need to first install robocopy from MS's site like I mentioned above)

C:\backup\backup.bat

@echo off
cls
setlocal
cd\
cd "C:\Program Files\Windows Resource Kits\Tools"

REM Set general Robocopy flags...
set flags=/mir /xo /R:0 /NP /TEE

REM ======================================
REM Backup the 'Desktop' folder...
REM --------------------------------------
set log=/LOG:"C:\backup\robcopylog_desktop.txt"
set source="C:\Documents and Settings\my_user_name\Desktop"
set dest="\\my_shared_network_folder\backups\desktop"
ROBOCOPY %source% %dest% %flags% %log%
REM ======================================

REM The script will now exit

 

Now you can use Scheduled Tasks (found in Control Panel of windows) to set up a re-occuring execution of this batch file on a daily or weekly basis, or whatever suits your needs. Or just double-click the batch file to run the backup only when you want.

 

The behavior of robocopy is very customizable. The current copy flags will ensure that the destination folder matches the source folder exactly:

  • Any files that exist in the source folder only will be copied to the dest folder
  • Any files that exist in the dest folder but not in the source folder will be deleted from the dest
  • It won't waste time mirroring files that already exist (it will only mirror new or changed files)

 

List of robocopy flags can be found here as well as several other places online if you google it:

http://www.xxcopy.com/xxcopy30.htm

 

 

 

When you say "robocopy" the only thing I can picture is Robocop getting a job at Initech. Those fuckers better not hassle him about his TPS reports.

Link to comment
Share on other sites

Seems like a sweet tool, but I suck at programming and cmd prompts, so I will stick to drag and drop.

 

problem is unless u have a "No To All" button, Windows will re-copy all your files which already exist in your backup folder.

 

u dont have to change anything in the .bat file except the line that say source & dest. just put the proper folder path u want in there ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share