[FASTCGI] Kill fastcgi process

Matthew Weigel unique at idempot.net
Thu Jul 30 17:25:08 EDT 2009


Matt wrote:
> "Bryan White" writes...
> ["When I have a new version is install by just moving the new version
> into place.  Note, a 'mv' is atomic.  A 'cp' could cause all sorts of
> problems."]
> So is it better than to use mv to overwrite a file then to use cp to overwrite the file? Whats the difference? What is the shell/OS
> doing different for a move Vs a copy?

It depends, actually.  If I recall correctly, within a single 
filesystem, 'mv' is - internally - just renaming the file.  On the other 
hand, 'cp' creates a new file, and then copies the data from the 
original file to the new file.  Crossing filesystem boundaries, mv 
behaves the same as cp, except that it deletes the source file afteward.

When you need to cross filesystem boundaries (typical filesystems are /, 
/usr, /home, /var, /tmp - but this really varies quite a bit), it is 
better to cp the file to some temporary file within the target 
filesystem, and then mv it to its final destination.
-- 
  Matthew Weigel
  hacker
  unique & idempot . ent


More information about the FastCGI-developers mailing list