Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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
!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:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .