From: Iain Buchanan <iaindb@netspace.net.au>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] kernel notification of file system changes
Date: Thu, 06 May 2010 11:47:14 +0930 [thread overview]
Message-ID: <1273112234.20354.67.camel@localhost> (raw)
In-Reply-To: <1273101884.20354.20.camel@localhost>
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 <iaindb at netspace dot net dot au>
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
prev parent reply other threads:[~2010-05-06 2:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-05 6:54 [gentoo-user] kernel notification of file system changes Iain Buchanan
2010-05-05 7:12 ` Bill Kenworthy
2010-05-05 23:29 ` Iain Buchanan
2010-05-05 23:33 ` Volker Armin Hemmann
2010-05-05 23:51 ` Iain Buchanan
2010-05-05 23:59 ` Volker Armin Hemmann
2010-05-05 13:34 ` Stroller
2010-05-05 17:24 ` Florian Philipp
2010-05-05 17:35 ` Stroller
2010-05-05 23:51 ` Iain Buchanan
2010-05-06 14:22 ` Stroller
2010-05-05 15:02 ` Helmut Jarausch
2010-05-05 23:24 ` Iain Buchanan
2010-05-06 2:17 ` Iain Buchanan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1273112234.20354.67.camel@localhost \
--to=iaindb@netspace.net.au \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox