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

Number : 5285 Date : 2003-08-11 Author : dayvah49 Subject : Re: Copy failed using /RCY/R to overwrite Read-Only file in destination Size(KB) : 3
Garry wrote: > I have now been able to duplicate the problem (not sure what I > did differently yesterday). The trigger is having the file already > in the destination with the RO bit set. Xxcopy is failing to > delete/overwrite the destination so fails the operation. I agree, but it surprises me because /RCY /H /R /ED /Pd0 are my switches of choice in most of my batch files! And incomprehensibly I have not experienced this problem after months of using many of those scripts. > I think this is a bug. IIRC /RC was grafted into xxcopy as something > of an afterthought to the /RS, /RD commands. Kan will need to look > into it. It looks like a bug to me also, but I'm a novice regarding anything command-line. > In the meantime, the quick fix is to remove the /KS switch which > will clear the RO bit when the file is copied to the destination. > Subsequent copies will be able to overwrite the file as required. If you are referring to my simple test, removing /KS doesn't seem to have any positive effect, i.e. overwriting the RO file. The switches I've tried that seem to allow overwriting of the read-only file in destination are /BU, /BI, or /BZX added with /RCY/R and I think they are probably overriding whatever is happening with /RCY/R. > If the destination is your reference directory, the RO bit won't > be significant. Correct, sort of. The zero byte reference directory is the staging ground for new and modified files that are copied from src to ref to dst. But then the src files in ref of 1 byte or more are copied to temp and then moved back to ref again as zero byte files using /RCY/R/Tr0 to update it for the next cycle of the loop, comparing src to ref. This is where the trouble starts because /RCY/R/Tr0 cannot overwrite the full size RO files in ref and delete those same files in temp. So the files in temp aren't moved back. > If the destination is your backup and you want/ > need to keep the attributes, you may need to add an extra step > to copy first then delete the source files. This will probably > require playing with the archive bit - set all on; copy and clear > archive bit (/M); copy and delete files with the archive bit set > with /RCY, /K0 and /TR0 to your reference directory. Note that you > will need to clear the RO bit in the reference directory first. In this technique I do not use /AZ /AA or /M. The key switches are /KS /BX in the first line. (see Kan's post Msg # 4529 at bottom of the page, Sunday, May 04, 2003 3:42 PM [xxcopy] Copy delta files to 3.directory). I think I just solved my problem with this work around in the line below! (see batch file below). xxcopy %ref% /ARR/SZ:1-/S // Clears RO bit for files NOT 0 bytes @echo off set src="h:\downloads\" set ref="h:\ref_h\" set tmp="h:\temp\" set dst="i:\archive\/$yyyy-mm-dd-hh.nn.ss$_i_downloads\" :loop xxcopy %src% %ref% /ks/h/r/s/bx/y/sz:-650M/qbl:650M if errorlevel 100 goto end xxcopy %ref% %tmp% /h/r/s/y/sz:1- xxcopy %tmp% %dst% /bu xxcopy %ref% /ARR/SZ:1-/S // Clears RO bit for files NOT 0 bytes xxcopy %tmp% %ref% /rcy/ed1/pd0/h/r/s/y/tr0 // HAD FAILED HERE! goto loop :end Thanks Garry for all your expert help! It will be interesting to read what Kan has to say about /RC/R. dayvah49
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.