anyone happen to know how NetApp's DataONTAP handles open files?
matt On Aug 2, 2004, at 3:04 PM, Jim Salter wrote:
Rsync does not handle open files. Your operating system does. Either the OS allows rsync access, or it doesn't. Quick crib sheet:
Normal behavior for *BSD or Linux systems: the root user has access to any file, at any time. Non-root users may or may not, depending on system configuration, but in my experience read-only use of open files is nearly always permissible on these systems, in the absence of special preparation otherwise (custom FLOCK, etc).
Win32 systems: These systems DO NOT allow access to open files, even for reading. Even if you are asking under Administrator or LOCALSYSTEM credentials. There is a workaround, but it costs a lot of money (approximately $850 last time I checked): the St. Bernard Open File Manager. The aforementioned app will allow you access to files which are currently under a no-read lock; without it, rsync just throws an error, skips the file, and moves on to the next one in queue.
HTH.
Jim Salter JRS Systems
I didn't see this answered in the FAQ, and it's important to one of my application owners.
How does RSYNC handle open or write in process files?
Thank you!
J
jadams@molex.com john.adams@molex.com
CONFIDENTIALITY NOTICE: This message (including any attachments) may contain Molex confidential information, protected by law. If this message is confidential, forwarding it to individuals, other than those with a need to know, without the permission of the sender, is prohibited.
This message is also intended for a specific individual. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message or taking of any action based upon it, is strictly prohibited.
-- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Matt Miller IT Infrastructure Duke - Fuqua School of Business
anyone happen to know how NetApp's DataONTAP handles open files?
matt On Aug 2, 2004, at 3:04 PM, Jim Salter wrote:
Rsync does not handle open files. Your operating system does. Either the OS allows rsync access, or it doesn't. Quick crib sheet:
When rsync copies a file, it creates a temporary file with a new, unused name. That way rsync never overwrites an existing file. After the new file is written, then rsync renames it into place, which unlinks (removes) the old file. This does not disturb any processes that still have the old file open. Unix does not destroy an unlinked file until all processes have closed it, so you can usually remove a LOCAL file that processes have open without causing any trouble. The system behaves just as if you waited until all processes closed the file before removing it.
But we are talking about rsync and ONTAP, which means we are talking about NFS.
Since NFS is stateless, ONTAP does not know which files NFS clients have open. Each NFS client keeps track of which files it has open, but does not know about files that other NFS clients have open.
If one process has a NFS file open and a second process ON THE SAME NFS CLIENT unlinks the file, then the NFS client actually renames the file to a name beginning with ".nfs" instead of telling the NFS server to unlink it. The first process continues undisturbed, unaware that the file has been renamed. When the first process closes the renamed file, then the NFS client unlinks it by telling the NFS server to unlink it. This behavior mimics LOCAL files. But alas, it doesn't work across NFS clients.
If a process has a file open and a second process on a different NFS client unlinks the file, then the NFS server unlinks the file. This whips the rug out from under the first process. If it tries to continue reading or writing the file, then it fails with "Stale NFS handle" errors.
So if one NFS client has files open and you run rsync on a second NFS client and it replaces those files, then the first NFS client will get "stale NFS handle" errors whenever it tries to access an open file that was unlinked out from under it.
Steve Losen scl@virginia.edu phone: 434-924-0640
University of Virginia ITC Unix Support