RE: [NTO] Re: Back-Ups and Syncing (Was: Checkboxes for selecting folders AND files)
- Actually, that made sense, although the actual command lines were foreign
until your explanation decoded them.
This sounds great. Isn't it funny that something so simple can confound?
Thanks for sharing that!
Christine this question, or a variation of it comes up quite often
over in the xxcopy forum. And yes, it can do it, and by coincidence
I just recently responded to someone who wanted to do a similar
thing. In his situation he has two computers several hundred miles
apart. He is the only one who uses the computers. What he wanted to
do was to synchronize the computer in location 1, to the one in
location 2 (and vice versa) by transporting the files back and forth
on a USB keyring drive. In other words he wanted both machines to
always be identical, at least in terms of his data files including
deleting any files that should not be there. Rather than retyping
the whole thing, I'll just copy and paste what I wrote to him in
xxcopy message #7911 from last Monday.
I know it'll be way over your head since you are not using xxcopy,
but hopefully you'll get the gist of how it can be done.
I think Garry came up with the best solution for you. Let me copy
and paste what he posted in message #7868 and then I'll add a few
extra comments to it to hopefully clarify to you what he was doing.
Bear in mind that all lines which begin with double colons (::) are
comments and will not actually do anything.
:: Create the skeleton directory.
xxcopy \src\ \usb\ /clone/pz0/tr
:: Ok what he did with the xxcopy line above, was to
:: create a skeleton directory on your USB device
:: that contains the names of all the files at the
:: location 1 PC. Every file on the source at
:: location 1 is represented in the skeleton, but
:: only the names of the files and paths are stored
:: in the skeleton. There is no data in the skeleton
:: files at this point. Therefore the size of the
:: skeleton on the USB device is very small and he
:: will use it later at location 2 to remove the
:: unwanted files from your other PC.
:: Add any new or updated files which have the archive
:: bit set then clear it after copy
xxcopy \src\ \usb\ /bu/b0/m
:: Now the line above this copies all files in the
:: location 1 PC that have the archive bit set, to
:: the skeleton directory on the USB device. Because
:: this is a "normal" copy, the full files will be
:: copied to the skeleton, thereby replacing any 0
:: sized files that were created in step 1. In case
:: you did not know this, the archive bit in files is
:: turned on (set to "A") any time a file has been
:: modified. So what he did in step 2 was to copy
:: only the modified files from the PC in location 1,
:: to the USB skeleton. The /M switch turns off the
:: archive "A" bit in the location 1 PC files after
:: the copy was completed. By doing it this way the
:: only files that will actually be copied to the USB
:: device each time, will be files that were changed
:: since the last time you did this action.
:: At the remote PC, copy any files > 0 bytes and delete
:: extra files
xxcopy \usb\ \dst\ /clone/sz:1-/pz0
:: The last step above takes place at your location 2
:: PC. It is a typical /clone operation which copies
:: the files from the source, to the destination
:: (including the subdirectories) while removing any
:: files in the destination that do not exist in the
:: source. This is where the skeleton on the USB
:: device comes in at location 2. Even though most
:: of the files in the USB skeleton are 0 sized and
:: have no data, the fact that they are there gives
:: xxcopy a way to compare your location 1 PC files
:: to the files on the PC at location 2. Any files
:: at location 2 will be deleted if they do not also
:: exist at location 1. The reason this works is
:: because Garry added the /sz:1 option which tells
:: xxcopy to ignore any 0 sized files in the source.
:: So the files in the USB skeleton that have no data
:: (0 byte sized) are not copied over, only
:: referenced to when xxcopy needs to know which
:: files to delete in the destination.
While this is an example of cloning location 1 files to location 2,
it would work the same way when cloning from location 2 to location
1. Of course you should do some extensive testing before actually
trying this with your "real" files at locations 1 and 2.
If this is still not clear, let us know where you need help yet.
Yahoo! Groups Links
- --- In ntb-OffTopic@yahoogroups.com, "Christine" <christine@e...>
> Actually, that made sense, although the actual command lines wereforeign
> until your explanation decoded them.confound?
> This sounds great. Isn't it funny that something so simple can
> Thanks for sharing that!Glad you were able to see through all that Christine. :)
Actually when you boil it all down, depending upon just how you
interface your laptop to your main computer, you could do what you
want with a couple simple clips such as:
^!Dos xxcopy "laptop" "main" /clone
Where ^!Wait simply tells NoteTab to hold its horses until the backup
is done, and even that is optional.
And of course in my above example "laptop" and "main" would have to
be replaced with the actual paths to each computer, but essentially
that's all it would take.
If you try this however, do a lot of testing on dummy files first.
xxcopy does exactly what it's told to do, so you'll want to be sure
you have your commands right.