Re: testing files for read errors by copying to /dev/null
On Mon, 24 Mar 2008 19:41:35 -0500, James Michael Fultz <xyzzy@sent.as.invalid> wrote:
>* Charles Russell <NOSPAM@bellsouth.net>:
>> James Michael Fultz wrote:
>>> $ find /cygdrive/d -type f -exec cp -v {} /dev/null \;
>>>
>>
>> That yields the error message:
>> cp: cannot create regular file `/dev/null': Invalid request code
>>
>> I don't know whether this is typical unix behavior or something peculiar
>> to Cygwin, which is usually a pretty close emulation. As noted in my
>> original posting, cp does not like /dev/null.
>My thought is that it is a pecularity of Cygwin since it worked when I
>tested on Linux.
>Your cp command lines seemed to fail for different reasons which are
>also failures on Linux. It is possible to copy a single file onto
>'/dev/null' which is itself a file, but it is not possible to copy
>directories onto '/dev/null' as the '-r' would require cp to do.
if you want to check that the file were copied properly, just copying from
the disk to the bitbucket is isn't going to be much . It only show that
the block checksums didn't have fatal errors. You can still have a ton
of data errors that won't be detected.
Either do an md5sum on both source and target files, or do a full comparison
between the source and target files. In linux, the diff command has a '-r'
option to check subdirectories recursively. (my solaris box has the same
option; cygwin which is mostly gnuish should have the same option)
|