Re: backups with git and inotify
- From
- Luciano Rocha <luciano@eurotux.com>
- Date
- Dec 11, 2007, 10:25 UTC
- Message-ID
- <20071211102546.GA5811@bit.office.eurotux.com>
- In-Reply-To
- <20071210215746.GA3022@atjola.homenet>
On Mon, Dec 10, 2007 at 10:57:46PM +0100, Björn Steinbrink wrote:
> On 2007.12.10 20:29:11 +0000, Luciano Rocha wrote:
<snip>
> > So, please, suggest. > > I posted an extremely simple bash script here: > http://lkml.org/lkml/2007/12/7/279
That thread was what motivated me to write the program, but I must've missed your post.
Show 6 quoted lines
> > It just employs inotifywait to do all watching and just needs to > translate the events to the different git command. Did just glance over > your code, but it seems to do basically the same thing, just that it's a > lot shorter. The overhead of being a shell script is probably neglible, > as the amount of git calls are likely dominating anyway.
Yes, being a shell script isn't a problem. I wasn't aware of inotify-tools, so I wrote my own. Still, the inotify-tools programs miss a check for ignoring directories with predetermined contents (I want to ignore sub-directories with their own git repository).
I think I'll contribute to inotify-tools a switch for that, and switch to perl. That will simplify the development and allow for coalescing events, so that updates with temporary files would be a simple update.
> Feel free to ignore my comments on why I think that that is crap anyway > and do whatever you want with the script.
FWIW, I also think that trying to keep a coherent stat with automatic commits isn't possible. As for the temporary, unneeded files, a exclusion pattern will suffice, and using .git directly, instead of a (FUSE) filesystem, will allow permanent storage of those temporary files, until explicitly removed.
Thanks, Luciano Rocha
-- Luciano Rocha <luciano@eurotux.com> Eurotux Informática, S.A. <http://www.eurotux.com/>