Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

corrupt file with mv while open?

Status
Not open for further replies.

kukuluku

MIS
May 2, 2002
56
US
I am planning to automate a procedure to move files from Oracle archive log destination when the file system's filling up. The Unix Administrator told me the move will corrupt file when it's still writing to it. I don't believe this happened when I use Sun box. We are now using HP-UX. Anyone experience this?

Your input is very much appreciated.
 
As per my experience it will not corrupt the file.

Patel
 
hi,

why don't you check before you move it to see if the file is in use , use the fuser command . if it is in use ignore it otherwise move it.

Another thing , why don't you zip the archive log files
using gzip .

Then after a month delete archive log files older than a week.



 
fuser - list processes using a file. Does this mean I need to get the file and then check if there's a process running?

I was thinking about compress. What is the difference between compress and gzip?

Thank you much in advance.
 
kukuluku,

I wouldn't move a file while it is being written to.

The difference between compress and gzip: compress is native to Unix (all flavors). gzip is a shareware program that usually must be downloaded and installed (most often, you also have to compile the source to get the binaries).

gzip sometimes gives better compression. But if you are going to be sending a compressed/zipped file to another, perhaps unknown system, I would use compress so you know you can uncompress the file. If the receiving system doesn't have gunzip, you're stuck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top