Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

For over 10 years, I've been using this strategy to copy a large number of files between UNIX filesystems:

cd source_directory
find . -depth -print | cpio -pdm /path/to/destination_directory

It works like a champ. However, I'm now getting this error from cpio:

cpio: WARNING! These file names were not selected:
(long list of files here...)

The source directory is on OSX 10.5, and the destination directory is a NFS filesystem from an OpenSolaris server. Copying over NFS has never been a problem in the past. There's nothing strange about the filenames, meaning there aren't special characters or anything like that.

Any ideas?

share|improve this question

1 Answer 1

Is the source directory hierarchy being used by something while you are doing the copy? I was able to elicit that error message (and some others) when I give it pathnames that do not exist:

% ls foo bar baz
ls: bar: No such file or directory
ls: foo: No such file or directory
baz
!1% # Only baz exists.
!1% printf %s\\\\n foo bar baz | cpio -odm > /dev/null
cpio: Unable to access foo <No such file or directory>
cpio: Unable to access bar <No such file or directory>
cpio: WARNING! These file names were not selected:
foo
bar

But I also get those earlier, other, explanatory error messages. Maybe you are getting so many of that latter that you can not see the former. You could try saving the output with cmd 2> logfile to save the stderr output to a file.

You could end up in this same situation if at least one other process deletes a file between when find prints its pathnames and when cpio opens it for reading. This is a race condition. The race is started by find (when it reads the directory, finding a particular pathname exists (eventually printing its pathname)) and contestants are cpio (wins when it successfully opens the pathname for reading) and some other process (wins when it deletes the pathname before cpio opens it).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.