Linux, rsync files excluding open/busy files

Matthias Schniedermeyer ms at
Wed Jul 14 05:24:44 MDT 2010

On 14.07.2010 12:06, bvidinli wrote:
> Hi,
> I read many posts about this, faq, googled, and finally got to write here.
> The scenario/question is this:
> I want to transfer files from Server B -> Server C
> the problem is that, files that are to be transfered may be open/busy,
> meaing they are "not still complete, " or they are open while rsync is
> run.
> Is there a way to automatically handle these open files using rsync ,
> rsync options ?
> I mean, It should be like " copy/rsync files to Server C, but exclude
> 'already open' files"
> I can handle this using lsof and excluding files individually, but, I
> would rather prefer rsync handles this automatically.
> If this feature is not present in rsync, I ask developers: this would
> be a very nice feature, something like "rsync --exclude-open-files
> sourcefiles dest/"

I personally would also like such a feature.

Altough i think somthing mtime based should suffice.
Something like "--min-age=60s", mtime has to be at least 60 seconds in 
the past. And i would restrict that to "real files", IOW 
directories/symlinks and so forth can't be "too new".

And maybe an option for selecting if the min-age shall be relative to 
the point in time the file is 'stat'ed or relative to the point in time 
rsync was started.

Bis denn

Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.

More information about the rsync mailing list