[<<]Message[>>]    [<<]Author[>>]    [<<]Subject[>>]    [<<]Thread[>>]

Number : 4705 Date : 2003-06-02 Author : Kan Yabumoto Subject : Re: Exclusion Question Size(KB) : 3
Garry wrote: > To use the example given by "edlight0" where he wants to > restore from a backup but preserve some selected files, > instead of using /CLONE, he can use the following 2 step > process: > :: Step 1 - copy any changed files from the backup > > xxcopy D:\backup\ C:\ /backup/xpagefile.sys/xhiberfil.sys > > :: Step 2 - delete any extra files in C:\ if they don't > :: exist in the backup but keep pagefile.sys and hiberfil.sys > > xxcopy C:\ D:\backup\ /bu/rsy/pd0/xpagefile.sys/xhiberfil.sys > We know Garry is often better than the author of XXCOPY in exploiting the features from the users perspective. Here, Garry's suggestion had an inadvertent typo error (it could have come from my earlier typo error --- entirely possible.) The second xxcopy command should use /BB/RSY rather than /BU/RSY. That is, we want to delete unique files in the C:\ directory rather than common files in both C:\ and D:\backup\ directories. Other than the typographic correction, I fully agree with Garry. The /Z and /ZY switch is simple and elegant on what it does. It is care-free with little to worry about. Since changing the behavior of XXCOPY with respect to the /Z action is very unpopular and we have little justification to do so. After all, the /Z switch is not broken. Let me summarize what options you have with respect to backup, restore, the /Z action, and exclusion. 1. We have two variations in general selective copy operations xxcopy \dir1\ \dir2\ /clone // with /ZY xxcopy \dir1\ \dir2\ /backup // without /Z 2. Adding /X or /EX will affect file selection in the source directory (\dir1\) 3. The /Z (and /ZY, also in /CLONE) action is determined solely by absence of the counterpart in the source directory (no other switches such as exclusion or inclusion operations affects the /Z action). If there are files in the destination directory that you do not wish to be deleted by the /Z action, you probably should not use the /Z (or /CLONE) switch. Instead, do the copy (you may call it "restore") operation without deleting anything (with /BACKUP rather than /CLONE), and in the following step, swap the arguments in the XXCOPY command and run a /RSY operation with exclusion features you like. Let me generalize what Garry wanted to say. Here's a very common backup (and restore) operation. xxcopy \dir1\ \dir2\ /clone It can be re-written as the following two-step operation xxcopy \dir1\ \dir2\ /backup xxcopy \dir2\ \dir1\ /rsy/bb/s/r/h/q Note: here, the order of the directories entered in the second command line is opposite of the first one. The important thing here is that /Z on the destination directory is equivalent to /RSY/BB on the source directory. The advantage of the two-step method is that in each operation we focus the operation into one thing (file-copy in the first step, and file-delete in the second step). The rich set of the XXCOPY file-selection mechanism can be fully exploited when you put the second directory (\dir2\) in the center stage. It includes file selections by name patterns /X, /EX, by size /SZ: by filedate /DA: /DB: /DO:,... by attributes /A, /M, /H, /Ho, /AT, /AX,... Probably it would be a mistake if we start adding variations to all these switches which will affects only on the files that would otherwise be selected by the /Z action. Kan Yabumoto
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.