|
|
Copying Large files in HPUX
Greetings,
I was copying some rather large files from one directory to another.
nohup cp -p bigfile.dat /tempdirectory/bigfile.dat > ~/cp.out 2>&1 &
Close to the time that I was copying some of those files another user
made some changes. I'm not sure when my copy finished (I was working
on something else), but I do know when they started to make the
changes. My question is this: If someone tried making changes to a
file while you were trying to copy it, what happens?
Does the changes and/or the copy fail?
Would you get output to standard error if the file changed from the
start of the copy to the end of it?
Would nothing happen except the date stamp be the same as the time the
last change was committed before the copy is complete?
Tsiaq
|
|
0
|
|
|
|
Reply
|
tsia_quithellen (3)
|
11/17/2005 12:13:36 AM |
|
tsia_quithellen@yahoo.com wrote:
> I was copying some rather large files from one directory to another.
> nohup cp -p bigfile.dat /tempdirectory/bigfile.dat > ~/cp.out 2>&1 &
> Close to the time that I was copying some of those files another
> user made some changes. I'm not sure when my copy finished (I was
> working on something else), but I do know when they started to make
> the changes. My question is this: If someone tried making changes
> to a file while you were trying to copy it, what happens?
> Does the changes and/or the copy fail?
No. IIRC the cp command does not use enforcement mode (I think that
is the term) locking.
> Would you get output to standard error if the file changed from the
> start of the copy to the end of it?
No.
> Would nothing happen except the date stamp be the same as the time the
> last change was committed before the copy is complete?
The copy may include, some, all, or none of the changes made by the
other person. It is all a matter of timing.
rick jones
--
Process shall set you free from the need for rational thought.
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
|
|
0
|
|
|
|
Reply
|
Rick
|
11/17/2005 1:22:49 AM
|
|
cp(1) does not perform any locking on the file, since it cannot afford
to do so. cp(1) copies files block by block, and each block would be
buffered. Since, it is a sequential copy, if any part that is currently
buffered is modified, then the updates will not be seen. Also, parts
already copied (the beginning part) of the file won't have the updates.
Besides, there is also a window involved, when the buffer is being
populated with data.
--Rajesh
|
|
0
|
|
|
|
Reply
|
rajesh
|
11/27/2005 12:02:58 PM
|
|
|
2 Replies
416 Views
(page loaded in 0.147 seconds)
|
|
|
|
|
|
|
|
|