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