From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1O9qgg-0006de-DQ for garchives@archives.gentoo.org; Thu, 06 May 2010 02:19:42 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E53C3E0896; Thu, 6 May 2010 02:18:39 +0000 (UTC) Received: from mail2.pcorp.com.au (mail2.pcorp.com.au [150.101.72.19]) by pigeon.gentoo.org (Postfix) with ESMTP id 0643CE0896 for ; Thu, 6 May 2010 02:18:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail2.pcorp.com.au (Postfix) with ESMTP id 4EDE2A70001 for ; Thu, 6 May 2010 11:48:37 +0930 (CST) X-Virus-Scanned: amavisd-new at mail2.pcorp.com.au Received: from mail2.pcorp.com.au ([127.0.0.1]) by localhost (mail2.pcorp.com.au [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eR0vyoqkl+RP; Thu, 6 May 2010 11:48:36 +0930 (CST) Received: from [172.16.0.52] (unknown [172.16.0.52]) by mail2.pcorp.com.au (Postfix) with ESMTP id D5492A00013 for ; Thu, 6 May 2010 11:48:36 +0930 (CST) Subject: Re: [gentoo-user] kernel notification of file system changes From: Iain Buchanan To: gentoo-user@lists.gentoo.org In-Reply-To: <1273101884.20354.20.camel@localhost> References: <1273042474.20354.17.camel@localhost> <1273101884.20354.20.camel@localhost> Content-Type: text/plain; charset="ISO-8859-1" Date: Thu, 06 May 2010 11:47:14 +0930 Message-ID: <1273112234.20354.67.camel@localhost> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.28.3.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 56ff48c4-c701-40df-a885-f487a6a03604 X-Archives-Hash: 9f8310f468cbbcf86c919873bc4c7a70 On Thu, 2010-05-06 at 08:54 +0930, Iain Buchanan wrote: > but it's an angle to follow. I wonder how max_user_watches would handle > being 100k or more... no doubt you just need some RAM?! > > thanks, To answer my own questions, I'm now trying this: # echo 100000 >/proc/sys/fs/inotify/max_user_watches $ time sudo find / -xdev -type d | sudo inotifywatch -v -t 1 -e modify,attrib,move,create,delete,delete_self,unmount --fromfile - Establishing watches... Total of 71169 watches. Finished establishing watches, now collecting statistics. Will listen for events for 1 seconds. total modify filename 6 6 /tmp/ 2 2 /dev/ real 0m3.177s user 0m0.768s sys 0m1.378s This sets up a watch on all directories under / that aren't part of another filesystem, and then exits after one second. It's quite fast :) The idea, off the top of my head, would be this: 1. inotifywatch as above but without the time restriction 2. wait for it to finishing "setting up" 3. rsync the whole directory structure to the backup 4. continuously do this loop: 1. get list of changes from inotifywatch 2. rsync those changes Unfortunately inotifywatch only returns output on ctrl-c, which I don't want to do or you loose anything changed between instances. This could be changed to another signal, no doubt. How does that sound for a continuous running backup? This is starting to stray OT from Gentoo, but your thoughts are welcome :) -- Iain Buchanan One cannot make an omelette without breaking eggs -- but it is amazing how many eggs one can break without making a decent omelette. -- Professor Charles P. Issawi