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

Number : 2820 Date : 2002-09-18 Author : Kan Yabumoto Subject : Re: Deleting selected files Size(KB) : 3
D.H.: I assume the two lines you showed are not to be run successively. Your first command line has a syntax error. One of the few things XXCOPY does not support the way XCOPY behaves is a destination specifier with filename template. That is, XXCOPY does not support the renaming (while copy) feature which we find is of limited use when the number of files are large. Therefore, XXCOPY does not support renaming which simplifies the syntax for the destination specifier. Since it is always a directory, with XXCOPY, the destination specifier is *ALWAYS* a directory name (with no wildcard allowed). In your case the second directory is only a "reference" for /BS for the /RS (remove source) operation. Still, no filename template is allowed in the second (destination) directory. So, I would write it this way: xxcopy /ec d:\backup\%number%\ h:\ /rsy/bs/s/r/h/pd0 Note that in the first line, /RSY // the suffix, Y will suppress Y/N on each delete /PD0 // suppress at the beginning of each dir operation /R // can delete files with read-only attribute /H // include system/hidden files I assume you wanted to delete the files in the d:\backup\%number%\ directory all the files that are exactly the same in the source (That is what /BS specifies). But, I'm a bit puzzled why you want to do that, even as the first step for a multi-step backup operation. A more conventional backup is to use /clone (which uses /BI/ZY combination among other things) which copies different (and new) files into the backup directory and delete extra files in the destination which is no longer present in the source. In that case, the order of the directory you specify will be different. xxcopy h:\ d:\backup\%number%\ /clone The second command line you showed looked OK. I'm not sure how you administer %NUMBER%. One convenient "advanced" feature in XXCOPY is to use day-of-the-week macro. /$www$ gives you a three-letter name (such as "sun", "mon", .. ,"sat"). Or, /$w$ which gives you the same thing in an ordinal value (0..6) where 0 = sunday, 1 = monday, ...). to put it in the command line, it would look like: xxcopy h:\ d:\backup\h_/$www$\ /clone If you run this command every day, you will end up with the following seven distinct directories d:\backup\h_sun\ d:\backup\h_mon\ d:\backup\h_tue\ ... d:\backup\h_sat\ Kan Yabumoto ======================================================= At 2002-09-18 15:42, you wrote: >I have written a batch file to back up modified files to a directory on a >rotating basis. I thought I could clear out the directory for re-use (on >the next rotation) using the commands > >XXCOPY /CE D:\BACKUP\%NUMBER%\*.* H:\*.* /RS /BS /S >XXCOPY /CE D:\BACKUP\%NUMBER%\*.* /RMDIR /Y /X*.ZIP > >(the first to clear out files present in the backup directory which are >duplicated on the original (H:) drive and the second to delete all files >except zip files) > >However the whole directory given by the environmental variable %NUMBER% >is up for deletion (actually I think I have to leave off the *.*). I could >do that with deltree.. > >Am I missing something? So far I am very impressed with xxcopy. >D.H.
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.