?
Solved

robocopy setup help

Posted on 2007-10-08
12
Medium Priority
?
2,536 Views
Last Modified: 2012-05-05
i have a drive G: that is a network drive and woudl like to robocopy everything from G: to e:\ full on monday and incremental tuesday thorugh thursday. I have robocopy already I was going to try something like this will this work please help thank you

robocopy g:\ e:\sbas /mir /xd
0
Comment
Question by:zenworksb
  • 6
  • 3
  • 3
12 Comments
 
LVL 15

Expert Comment

by:qz8dsw
ID: 20038512
/xd doesn't look right at all.
"/XD dirs [dirs]... : eXclude Directories matching given names/paths."

Perhaps you meant /XO
"/XO : eXclude Older - if destination file exists and is the same date or newer than the source - don't bother to overwrite it."

For your incrementals /XO should get the job done.
For your full, /mir should work a treat.

Please note however you are not copying over the security, owner or auditing information (Because of not speficying the /copy option).
"/COPY:copyflag[s] : What to COPY (default is /COPY:DAT).
(copyflags : D=Data, A=Attributes, T=Timestamps).
(S=Security=NTFS ACLs, O=Owner info, U=aUditing info)."

You might also need /IA:RASHCNETO to be sure you pick up ALL files (Promarily the system and hidden ones)

http://www.ss64.com/nt/robocopy.html

Terry
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20038570
by default, robocopy does incremental...

to make a full copy, you either use the /IS flag, or don't use robocopy at all..

http://www.ss64.com/nt/robocopy.html
0
 
LVL 15

Expert Comment

by:qz8dsw
ID: 20038614
Actually Angel Robocopy will not by default do an incremental. (Copy newer files from source to the destination)
It just copies ALL files with different timestamps or sizes.
BUT the senario you update one on the destination (for later migration) would be over-written without specifying /XO
Also good catch on the /IS, Knew I was missing something on the full command line.

Terry
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20038622
>It just copies ALL files with different timestamps or sizes.
that is, for me, an incremental. anything that changed / is different gets copied...
maybe you can enlighten me on the difference?

0
 
LVL 15

Expert Comment

by:qz8dsw
ID: 20038672
Hi Angel,
Sometimes I think in a "prod/development/DR" mindset abit too much.

I'm used to things like Arcserve/Brightstore, medium/enterprise backup packages backing up to offline media, but also do abit of this with source control on disk (Hence my pointing out about the destination being modified).
Incrementals (In my mind) should only backup files from the source that have changed since the last full backup.
Whats on the target is not relevant at all. It's just if it's changed on the source since the last full backup.

Then theres differential backups, which is backing up everything thats changed on the source since the last backup (NOT full backup). So restoring them can be a pain because you have to restore your full and every differential since the full. At least with the incrementals you only have to restore the last incremental.

The archive attribute for files/directories is used alot for identifying such files.

I might be going abit too far with what I'm saying about /XO, was just thinking about it alone the lines of how I'd do it with what I understand an incremental backup to be which is totally source computer based.

Terry.
0
 
LVL 15

Expert Comment

by:qz8dsw
ID: 20038683
BUT also thinking about them modifying the destination files (A development enviroment) and what would happen to their modified files.
0
 

Author Comment

by:zenworksb
ID: 20042094
so if I setup a batch file to run this every monday as my full

robocopy g:\ e:\sbas /mir /xd

and this tuesday thorugh thursday as the incremental

robocopy g:\ e:\sbas /mir

thsi shoudl work?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20042221
yes, at least that is what I would think of the parameters...
0
 

Author Comment

by:zenworksb
ID: 20042323
quick question someone deleted or i deleted the robocopy :) where can I download it
0
 
LVL 15

Expert Comment

by:qz8dsw
ID: 20043034
http://go.microsoft.com/fwlink/?LinkId=4544
It's the windows 2003 resource kit with an updated robocopy.

And for your command line the /XD is for expluding directories but your not specifying any to exclude.

For your weekly
robocopy g:\ e:\sbas /mir /IA:RASHCNETO

For your incremental
robocopy g:\ e:\sbas /IA:RASHCNETO
or
robocopy g:\ e:\sbas /XD /IA:RASHCNETO
Depending on wether or not you want the source to overwrite any files changed on the target.

Terry
0
 

Author Comment

by:zenworksb
ID: 20043860
what I would like is for there to be a directory called sbas for the full
then a incrmental location for tuesday -friday with four different folder tuesday wednesday thursday friday. i only want chagned files in teh tuesday through friday
0
 
LVL 15

Accepted Solution

by:
qz8dsw earned 2000 total points
ID: 20046381
Robocopy is not really built for doing that on the fly.
Robocopy is good for backup and archive, BUT it needs to know what files are on the destination as a comparision.
Sounds like you'll have to make use of the archive attribute on files.
The /mir switch is what you want for the full, BUT doing a /mir does not reset the archive bit for the file. (So you can see the files changed for your incremental backups)

Just in case you didn't know, the archive attribute is set on a file when it's modified in any way.
It's an easy way for software to know if files have changed since the last backup.

Robocopy has no way I know of to reset the archive bit on all file after the full backup, so 2 ways to go.
1) add a command in the batch file after robocopy that does a
attrib -a g:\ /s /d
That command removes the archive attribute on all files and directories. (But does increase the time it would take for a full backup)
Then for your incrementals
robocopy g:\ e:\Monday /M /IA:RASHCNETO
or
robocopy g:\ e:\Monday /A /IA:RASHCNETO
A batch file could easily be created that got the day of the week as a variable so you didn't need to create one command for each incremental.

The difference between /M and /A?
/M resets the archive bit on files, So that means in the monday directory you only have files that were modified since the last FULL backup (Lets say Sunday)  Tuesdays directory backs up all files changed since Mondays backup, etc....

/A DOES NOT reset the archive bit on files, So that means in the monday directory you only have files that were modified since the last FULL backup (Lets say Sunday)  Tuesdays directory backs up all files changed since the last full backup, etc....

2) Use XXcopy or windows backup (Or a more robust backup solution).
XXCopy is VERY much in the same vain as Robocopy, but with a few subtle differences. (Notibly being able to reset the sources archive bit when using /clone(It's version of robocopies /mir) )
http://www.xxcopy.com/xxcopy30.htm
Windows Backup is more suited to doing the whole full,incremental scheme (And probably faster)

Terry
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you unable to synchronize your OST (Offline Storage Table) file with Microsoft Exchange Server? Is your OST file exceeding 2 GB size limit? In Microsoft Outlook 2002 and earlier versions, there is a 2 GB size limit for the OST file. If the file …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Screencast - Getting to Know the Pipeline
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question