cpio deleting source files. Can't figure out why!

So I ran into a strange problem the other day when using cpio. I'm not really sure this needed to be in an HPUX specific forum, but wasn't sure where else to put it. I'm running HPUX 11.11 PARISC.

I was using cpio to copy a directory and its entire contents from one server, we'll call it server A, to another server, we'll call it server B, via an NFS mount.

Server A is exporting /source/dir, and server B is mounting it as a client, mounting it as /nfs/source/dir. My current working directory on server B was /nfs/source/dir. As you can see, I am trying to copy all the contents of /nfs/source/dir into /dest/dir. here is the command I ran, sitting inside /nfs/source/dir:

find . | cpio -pmduv /dest/dir/.

It copied all the files to the destination directory just fine, but after it did that it prompted me with a message asking if it's ok to delete a file. I wasn't sure what file it was referencing, but I didn't want to delete anything, so I told it no, and it went on to ask me about more files. I cancelled out of it. Well it seems that it deleted some files without prompting me before I got the first prompt. (I think permissions of some files allowed it to delete without prompting me)

Why would cpio remove files from the source after the copy was done?

I found a couple links referencing a similar issue, but I'm not doing it the same way as either of them. Here are the links in case you're curious:
[TCLUG] cpio bug?
[Bug-cpio] CPIO can also delete the files from destination location.

I tried reproducing the problem in a test directory and couldn't do it. Even using the methods used in those links, (which are very old), I couldn't get it to replicate the problem. I did get it to give me an error saying that it couldn't copy from one directory to the same directory, when trying to basically copy from one directory back to itself, but it certainly didn't try deleting anything, and it's not even close to the command I was running.

Any ideas as to why this would happen?

My system doesn't have this -u option, what's it do on yours?

The second link is GNU specific - you're running on HP-UX....

The u does an unconditional file copy. In other words, normally, cpio would only copy changed files. The u tells it to copy everything, no matter what. I did that because I had a large number of files in the destination dir already, and wanted everything overwritten fresh.

Ah, you're right. Oh well, moot point, didn't help anyway.

First lose the dot in the destination directory name and use the command in the manner described in man cpio plus an nfs-specific parameter:

find . -xdev -depth -print | cpio -pmduv /dest/dir

I have never heard of cpio asking about deleting source files.
Make sure that you don't have either a script or alias which clashes with the commands:

type cpio
type find

Well the dot in the destination wasn't originally there, and it doesn't seem to make a difference. I've since tried tests with and without it, and can't replicate the problem.

Neither cpio or find have any other scripts clashing with them, the type command finds them both in /usr/bin.

The tests I'm currently running are also over NFS, and I can't replicate the problem, no matter how I type the command. Is it possible that a file in the source dir caused it?

Accuracy and full factual data is essential to diagnose this sort of fault.

First check that you do not have . in $PATH . This can give trouble if any executable file in the current working directory has the same name as a system command. If in doubt use absolute path names for commands in system scripts or set a custom $PATH specific to the script.

Incorrect use of asterisk characters in a command is more likely, and you probably ran some cleanup script by mistake.

Yeah sorry about that, I hadn't even realized it till you mentioned it. I looked at my $PATH , no . there. So when you say that I may have accidentally run a cleanup script by mistake, how would that have happened? Could cpio have executed something it was trying to copy? Cause I didn't run anything after the command, after it was done copying it just immediately started asking. It actually wasn't really asking if I wanted to delete, I want to say the syntax of what it was saying was something like

Chmod 750... Are you sure?

Something along those lines. At first it seemed like it was trying to change the permissions of some files. It wasn't until that evening we realized it had deleted a bunch of files.