![]()
[<<]Message[>>] [<<]Author[>>] [<<]Subject[>>] [<<]Thread[>>]
Number : 5290 Date : 2003-08-12 Author : Garry Deane Subject : Re: Copy failed using /RCY/R to overwrite Read-Only file in destination Size(KB) : 2
--- In xxcopy@yahoogroups.com, "dayvah49" wrote: > @echo off > :loop > :: copies a quota of files to zero byte file ref > xxcopy c:\ d:\ref_c\/ks/h/r/bx/sz:-650M/qbl:650M/s/y > if errorlevel 100 goto end > :: copies files that are NOT 0 bytes to temp > xxcopy d:\ref_c\ d:\temp\/h/r/s/y/sz:1- > :: clears RO bit files that are NOT 0 bytes > xxcopy d:\ref_c\/arr/sz:1-/s > :: updates ref with 0 byte files for next loop cycle > xxcopy d:\temp\ d:\ref_c\/h/r/s/tr0/y > :: wzzip moves files and folders into zip file > :: note! wzzip syntax has src to right & dst to left! > wzzip -m -u -ex -r -P -whs -Jhrs d:\temp\C.zip d:\temp\ > :: moves zip to today's date directory > xxcopy d:\temp\C.zip d:\temp1\/$yyyy-mm-dd$\/rcy/ed/pd0/y > :: adds date to file name with directory flattening switch > xxcopy d:\temp1\*\* d:\temp2\/rcy/ed1/pd0/sl/y > :: appends file name with consecutive numbers > xxcopy d:\temp2\ f:\burn_cd\/rcy/ed/pd0/sgf/y > goto loop > :end You're batch file looks quite effective, well done! My only comment is that the operations involve a large number of copy and move operations on the full data set or zip file. Since this involves around 600Mb (depending on compression ratio) being moved around 6 times each loop, I think I'd use a utility other than xxcopy to manage the file naming scheme. This utility only has to get the date and increment a counter and you could reduce the operation to 2 copies instead of 6 using the same naming scheme! There are plenty of utilities that can do this. The venerable STRINGS.COM or M.EXE ftp://ftp.externet.hu/pub/mirror/sac/utiltask/m403.zip Here's what I would do (ignoring how you get the date and counter). Carry out your first xxcopy command to the ref directory as you've done but add file logging with /Fo:filelist.txt/FML. This will be used by wzzip as an input file list. Then xxcopy the non-zero length files from the ref directory to a temp directory but with /TR:0. Then copy back from the temp directory to the ref directory using /RCY. The effect of these 2 steps is to set the filelength of the previously copied src files in the ref directory to zero. Since this only creates the directory structures but doesn't copy any data, it has a low overhead. Now issue your wzzip command using @filelist.txt as the source file list and the previously determined date and sequence number as your zip file name. This can be created directly to the burn_cd directory by excluding *.zip files in the wzzip command. And that would be it. 1 copy to the ref directory and one copy by the wzzip command. Garry
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.