Best way to keep a copy of a directory

May 30, 2008
120
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.
 
May 20, 2008
603
0
Sammamish, WA
> 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
34
0
"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
120
1
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
 
Similar threads
Thread starter Title Forum Replies Date
S How to? best way to compose data for command to use out of presets/variables Support 1
C Best way to validate a string is a YYYYMMDD Support 7
p.f.moore Best way of embedding data in a BTM file Support 12
A Best Practice for TCMD11 Windows7 64 Support 2
R best file compare util Support 5
tinjaw Looking for best practice for custom environment on tabs Support 0
C Can't keep up with my typing? Support 9
M Why does HELP keep opening in the background? Support 0
vefatica Why does my forum theme keep changing? Support 1
CWBillow Wrong icons keep sticking Support 6
C Any reason to keep old versions? Support 8
Stefano Piccardi How to? keep console from scrolling Support 6
vefatica Keep me logged in? Support 2
R wishlist: in update keep previous settings Support 9
C Copy (sys) error Support 3
Alpengreis Fixed Crash after copy dialog with big TCC.exception.log Support 5
vefatica Copy/Paste anomaly Support 4
D Documentation Typo in COPY help Support 0
samintz COPY fails to copy from \\wsl$ Support 20
D Differences between TCC and CMD with COPY /b Support 4
fpefpe copy /u and timestamps Support 4
M Strange error messages from TCC in FTP copy Support 7
G TCMD crash when copy Support 3
Alpengreis How to? Copy DIRs with attributes ... Support 4
E Text copy bug Support 1
Alpengreis [TCMD v25.00.24] Problem with copy and paste and the # char via mouse in TCC Support 6
fpefpe copy/cat Support 7
K copy /w slow relative to robocopy /mir Support 0
Jay Sage Problem with Context Menu Copy+Paste+Run Key Assignment Support 7
K "copy /z /w" command not deleting read-only files in destination Support 10
K copy changing destination current directory Support 1
D Keystroke to copy previous argument Support 3
A How to? Copy+Paste in TCMD tabs with Ctrl-Shift-Ins? Support 5
RChrismon How to? Copy TCMD.INI to New Version Support 7
R How to? Append files in multiple subfolders using copy? Support 8
Dick Johnson COPY /u (?) Support 9
fpefpe Documentation copy /u Support 7
R How to? copy /q ABC.txt + DEF.txt is appending hex 1A Support 8
D copy /g only shows transfer rate Support 1
J Error "Contents lost before copy" Support 3
B Can copy command concatenate multiple mp3 files Support 2
rps Documentation "Copy+Paste+run" question Support 2
kb6ojs Make /G parameter persistent in COPY/MOVE command? Support 4
fpefpe How to? copy / exclude Support 2
fpefpe robocopy -- copy /w Support 8
C copy /w /p prompts for deletion, but ... Support 3
D Fixed Copy Support 1
fpefpe Documentation copy/move using /c or /u Support 2
samintz WAD Copy/append adds a character Support 3
P Simple RegEx copy Support 9

Similar threads