Best way to keep a copy of a directory

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
May 30, 2008
122
1
#1
I want to back up a directory to a second drive. Basically, I want to
copy all changed files, delete any removed files, but avoid copying
more than necessary. Essentially, the equivalent of RD /S /Q dest &
COPY /S src dest, but without copying unchanged files. This seems like
a common enough task, but I'm finding it hard to get the correct
command.

COPY /S /C src dest nearly does it, but doesn't delete any files
removed from src.
SYNC /S /W src dest also nearly works, but if a file in dest is
modified, it copies it back.

My best option so far is SYNC /S /W, and try to ensure that the
destination files are never modified. But as this is for backup
purposes, I'm a bit nervous. COPY /S /C isn't really useful, as if I
use this for a relatively volatile directory (my working directory,
for instance) the backup will grow indefinitely with stuff that I
tried for a while then deleted.

Have I missed any good options? (Hmm, I keep hearing good things about
the MS ROBOCOPY utility - maybe I should look at that. Does anyone
know if that would help me?)

Paul.
 
#2
> Have I missed any good options? (Hmm, I keep hearing good things about
> the MS ROBOCOPY utility - maybe I should look at that. Does anyone
> know if that would help me?)
I regularly use "ROBOCOPY /MIR source destination" which ensures the
destination is now a perfect mirror of the source after the copy.

I was using it before I got used to SYNC or COPY options that may
serve the same purpose, so I haven't looked into those as much.


--
2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Saturday.
Measure wealth by the things you have for which you would not take money.
 
Jun 10, 2008
35
0
#3
"p.f.moore" <> wrote:

> Have I missed any good options? (Hmm, I keep hearing good things about
> the MS ROBOCOPY utility - maybe I should look at that. Does anyone
> know if that would help me?)
For automatic batch-like jobs I swear by robocopy. It's versatile, small
and rock-solid (its parentage notwithstanding).

For interactive jobs where I need more control, I use a software called
Synchronize It! (see http://www.grigsoft.com/ ). This is the best
file/directory synchroniser I have found in many years of searching.

HTH.

--
cheers thomasl

web: http://thomaslauer.com/start
 
May 30, 2008
122
1
#4
2008/9/9 thomasl <>:

> "p.f.moore" <> wrote:
> ---Quote---
>> Have I missed any good options? (Hmm, I keep hearing good things about
>> the MS ROBOCOPY utility - maybe I should look at that. Does anyone
>> know if that would help me?)
> ---End Quote---
> For automatic batch-like jobs I swear by robocopy. It's versatile, small
> and rock-solid (its parentage notwithstanding).
Thanks, I'll get a copy of robocopy and see how things go.
Paul