git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: backups with git and inotify

From
LRLuciano 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/>
Previous: Björn SteinbrinkNext: David Tweed
Message 5 of 6 in “backups with git and inotify”
  1. Luciano RochaDec 10, 2007
  2. David TweedDec 10, 2007
  3. Luciano RochaDec 10, 2007
  4. Björn SteinbrinkDec 10, 2007
  5. Luciano RochaDec 11, 2007
  6. David TweedDec 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.