On Mon, Nov 21, 2005 at 10:19:31PM -0700, Bob Proulx wrote: > Jonathan Black wrote: > > Coping a file to a local filesystem using the -p option preserves the > > timestamp as expected, but doing the same to an nfs filesystem replaces > > it with the current time, as if -p had not been given: > > Mostly likely this is a limitation of the NFS server. Most likely a > feature restriction. > > > $ cp -p /etc/debian_version /tmp > > $ cp -p /etc/debian_version /net/beacon/tmp > > $ ls -l {/etc,/tmp,/net/beacon/tmp}/debian_version > > -rw-r--r-- 1 root root 17 2005-06-06 19:50 /etc/debian_version > > -rw-r--r-- 1 jonathan jonathan 17 2005-11-21 23:40 > > /net/beacon/tmp/debian_version > > -rw-r--r-- 1 jonathan jonathan 17 2005-06-06 19:50 /tmp/debian_version > > Thank you for the small test case. Would you please run the case > again using strace and send in the result? > > strace -e file cp -p /etc/debian_version /tmp > strace -e file cp -p /etc/debian_version /net/beacon/tmp > > On my system I see this: > > utimes("/net/marbles/tmp/debian_version", {1132636652, 0}) = 0
OK, thanks for the suggestion: $ strace -e file cp -p /etc/debian_version /tmp 2>&1 | grep time utimes("/proc/self/fd/5", {1132653385, 0}) = 0 $ strace -e file cp -p /etc/debian_version /net/beacon/tmp 2>&1 | grep time utimes("/proc/self/fd/5", {1132653424, 0}) = 0 $ ls -l {/tmp,/net/beacon/tmp}/debian_version -rw-r--r-- 1 jonathan jonathan 17 2005-11-22 10:57 /net/beacon/tmp/debian_version -rw-r--r-- 1 jonathan jonathan 17 2005-06-06 19:50 /tmp/debian_version > My suspicion is that the NFS call is given but ignored by the NFS > server. Can you try a different NFS server? Well, the result from my sid box on which I'm seeing the problem is the same to all three NFS severs in my vacinity (one is sarge, one etch and one Ubuntu Breezy), timestamp is not preserved. However, borrowing the `cp' binary from one of those machines turns out to be enough to make it work: $ strace -e file /net/beacon/bin/cp -p /etc/debian_version /net/beacon/tmp 2>&1 | grep time utimes("/net/beacon/tmp/debian_version", {1132653427, 0}) = 0 $ ls -l {/tmp,/net/beacon/tmp}/debian_version -rw-r--r-- 1 jonathan jonathan 17 2005-06-06 19:50 /net/beacon/tmp/debian_version -rw-r--r-- 1 jonathan jonathan 17 2005-06-06 19:50 /tmp/debian_version So it seems to definitely be a problem in the recent version of cp, and the striking difference to me is that it uses "/proc/self/fd/5" in the utimes call, where older versions (the ones on my other machines, and yours) use the literal path of the destination file. Should this matter? -- jonathaN -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]