exclude open file in backup with rsync

2006-03-22 Thread IMCC
hi,
   I am working on Backup appliction.
   So I am understanding  rsync_2.6.6.

   I have to take a backup of files on a drive But 
   I  have to exclude those file in a drive which are open. 

   I want to know  whether rsync exclude open files
   while taking backup ? .

   and how rsync identify a file  open or not.
   what test on a file rsync does.

  sunil
 SPSOFT
   
 

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: exclude open file in backup with rsync

2006-03-22 Thread Matt McCutchen
On Wed, 2006-03-22 at 19:27 +0530, IMCC wrote:
I have to take a backup of files on a drive But 
I  have to exclude those file in a drive which are open. 
 
I want to know  whether rsync exclude open files
while taking backup ? .

Rsync sends all files without checking whether they are open.  If a file
is being read concurrently, rsync will send it correctly.  If a file is
being written concurrently, rsync will transfer each piece of the file
as it existed at the moment rsync read that piece.  That means you can
potentially get a combination of new and old data.  _If_ the concurrent
writing continues after the second during which rsync stats the source
file, the source file will be newer than the destination file and rsync
will fix the destination file when you next run it.

You might be able to get your operating system to enforce mandatory
locking on the files in question, in which case if the writer takes a
write lock, rsync's reading will be delayed until the writing finishes.
To simply exclude open files, you could run fuser on all the files and
translate the results into exclude rules, but files might open and close
after rsync starts.
-- 
Matt McCutchen
[EMAIL PROTECTED]
http://hashproduct.metaesthetics.net/

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html