Copying updated files

J

JDGuin

I keep two copies of my files at work, each on their own drive. At the end of
the day, I want to copy from one drive to the other (1) all the files that
have been created and updated, as well as (2) any NEW directories and
subdirectories that have been created. (You would think that negating /-T
would work, but it doesn't.) It would also be nice if it would (3) delete
subdirectories I've deleted, but I don't want to ask for the moon.

You would think XCOPY would have a switch to do this, but if so I haven't
been able to puzzle it out. It dances all around it, but doesn't make one -
or a combination - to do specifically that. No matter what I try, if I copy a
file from one subdirectory (folder) to another, a new folder - with the exact
same name, which I didn't think was possible - is created, with the file
inside.

Is there any way to use XCOPY to update my second drive with all changes
made to the first, including new directories, but ONLY new directories? If
not, can anyone suggest a way to do this, preferably without messing about
with the registry? Thanks.
 
P

Pegasus [MVP]

JDGuin said:
I keep two copies of my files at work, each on their own drive. At the end
of
the day, I want to copy from one drive to the other (1) all the files that
have been created and updated, as well as (2) any NEW directories and
subdirectories that have been created. (You would think that negating /-T
would work, but it doesn't.) It would also be nice if it would (3) delete
subdirectories I've deleted, but I don't want to ask for the moon.

You would think XCOPY would have a switch to do this, but if so I haven't
been able to puzzle it out. It dances all around it, but doesn't make
one -
or a combination - to do specifically that. No matter what I try, if I
copy a
file from one subdirectory (folder) to another, a new folder - with the
exact
same name, which I didn't think was possible - is created, with the file
inside.

Is there any way to use XCOPY to update my second drive with all changes
made to the first, including new directories, but ONLY new directories? If
not, can anyone suggest a way to do this, preferably without messing about
with the registry? Thanks.

Hacking the registry is definitely not the answer. On the other hand I am
not sure that I completely understand what you're trying to achieve. A
couple of examples might clarify the issue - one example showing what you
*do* want to copy, the other with what you *do not* want to copy.
 
J

JDGuin

OK.

Say, at the beginning of my workday, both Drives are the same: they both two
folders, Folder 1 & Folder 2. Folder 1 contains two files, File 1 and File 2,
and Folder 2 contains one file, File 3.

During the day, File 1 is changed, File 2 is not changed, File 3 is deleted,
and Folder 3 is created and contains File 4.

I need to make Disk B match Disk A. And if there are any subfolders, I need
them to be handled similarly. I need to do this without duplicating folders,
which XCOPY does. For example, if I tell XCOPY to copy only files created
today from a given folder on Disk A, it filters the files all right, but
instead of understanding the existing directory structure and noticing that
the destination folder already exists, it creates another folder with the
same name.

It seems a simple enough concept. Disk A & Disk B are identical at the
beginning of the day. During the day, Disk A is changed. Before I leave work,
I want to make Disk B identical again to Disk A. I want a command to change
Disk B -- to copy changed files, copy new files, delete deleted files, create
new folders and subfolders and delete folders and subfolders I deleted during
the day, along with any files they contain.

Copying one disk to another is time-consuming when the disks contain a large
quantity of information; and copying individual files and folders is
cumbersome if many changes have been made.

Do you know how this can be done?
 
P

Pegasus [MVP]

I keep tripping over your statement "noticing that the destination folder
already exists, xcopy creates another folder with the same name". This, as
I'm sure you're aware, is impossible: You cannot have two folders of the
same name on the same drive. In other words, if the folder

Q:\Data\Folder1

exists then it is impossible to create a further folder of the name

Q:\Data\Folder1

Anyway, if you wish to synchronise folders then robocopy.exe /purge may be
your answer. You can get it from here:
http://www.microsoft.com/downloads/...69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
 
D

dadiOH

JDGuin said:
I keep two copies of my files at work, each on their own drive. At
the end of the day, I want to copy from one drive to the other (1)
all the files that have been created and updated, as well as (2) any
NEW directories and subdirectories that have been created. (You would
think that negating /-T would work, but it doesn't.) It would also be
nice if it would (3) delete subdirectories I've deleted, but I don't
want to ask for the moon.

You would think XCOPY would have a switch to do this, but if so I
haven't been able to puzzle it out. It dances all around it, but
doesn't make one - or a combination - to do specifically that. No
matter what I try, if I copy a file from one subdirectory (folder) to
another, a new folder - with the exact same name, which I didn't
think was possible - is created, with the file inside.

Is there any way to use XCOPY to update my second drive with all
changes made to the first, including new directories, but ONLY new
directories? If not, can anyone suggest a way to do this, preferably
without messing about with the registry? Thanks.

Karen's Replicator
http://www.karenware.com/powertools/ptreplicator.asp

--

dadiOH
____________________________

dadiOH's dandies v3.06...
....a help file of info about MP3s, recording from
LP/cassette and tips & tricks on this and that.
Get it at http://mysite.verizon.net/xico
 
J

JDGuin

Thanks for the suggestion. From the description, the program looked like it
might do what I need done. However, when I downloaded it, it wouldn't intall.
 
J

JDGuin

I assure you, it happened. I was surprised.

I just tried to reproduce the effect, and for some reason this time it
worked like it was supposed to. This is like when you car has a problem, you
take it to the mechanic, and everything works fine.

It may be impossible, but it happened anyway. I know. I saw it.

Now that I got it to work, perhaps my problem is solved. On the other hand,
it may act up again. If it does, I'll come back and tell you about it.

Thanks for your kind attention.
 
P

Pegasus [MVP]

Next time you think you see two directories of the same name, nail down the
evidence like so:
- Open a Command Prompt.
- Type the following commands:
dir "Q:\My Files" > c:\dir.txt
notepad c:\dir.txt

Replace Q:\My Files with the actual name of the folder that you believe
holds two subfolders with identical names. When finished, post the contents
of c:\dir.txt. Note also that the following two folder names are *not* the
same:

Q:\My Files\Budget 2009
Q:\My Files\Budget 2009

Note also that one can add a hidden space ($FF) to the end of a file name.
This could give the appearance of identical names even though they are quite
different. The method I showed you further up would reveal this too.
 
B

Bob I

XCOPY would have to function completely outside the the Windows
operating system for this to occur. This is tantamount to telling the
mechanic that the reason your car is not working properly is because
there are 7 pistons in your engine instead of 6. Because it works
properly when you show him, it is not because the "extra piston" vanished.
 
A

Anthony Buckland

JDGuin said:
I keep two copies of my files at work, each on their own drive. At the end
of
the day, I want to copy from one drive to the other (1) all the files that
have been created and updated, as well as (2) any NEW directories and
subdirectories that have been created. ...

Like some other responders, I'm not sure I know _exactly_
what you want to achieve, but here's the XCOPY
command I use to do something similar, namely updating
on a USB thumb drive a saved copy of My Documents.
The command is issued while in My Documents, with the
thumb drive mounted as J:

XCOPY *.* J: /D /E /C /Q /H /R /Y /K

Check out the eight switches I've used and see if this
command is useful to you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top