threads / discuss / 25171

Mirror plain directory under git

Subject: Mirror plain directory under git

## tl;dr

5 messages between Sep 20, 2010 and Sep 24, 2010.

replies: 4people: 3as markdown or json

Tong Sun· Sep 20, 2010, 19:12 UTC · lore
Hi,

How feasible it is to mirror a plain directory and put it under git revision control (leaving the original intact)?

More or less like what etckeeper is doing to revision /etc directory. I.e., I want to use git + some magic to replace rdiff-backup, so as not only easily to restore, but also easy to track revision changes as well.

It is just a wild dream?
Please CC me when replying.
Thanks
Enrico Weigelt· Sep 21, 2010, 07:56 UTC · re: Tong Sun · lore

Re: Mirror plain directory under git

* Tong Sun <suntong@cpan.org> wrote:
Hi,
> How feasible it is to mirror a plain directory and put it under git
> revision control (leaving the original intact)?

Probably you'll want to have the .git dir outside of /etc, so --git-dir and --work-dir are your friend (man 1 git).

An cron-script could look something like that:
    #!/bin/bash
    cd /var/my-etc-archive.git && \
	git --work-dir=/etc add -A && \
	git --work-dir=/etc commit -m "autocommit" && \
	git push origin

(perhaps filter the output a bit, so you don't get unncessary cron mails ;-))

cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
Daniel Johnson· Sep 24, 2010, 14:36 UTC · re: Enrico Weigelt · lore

Re: Mirror plain directory under git

I know nothing about the subject matter of your email, but the date appears to be wrong on this email message, hiding it back further in the history than it should be. Just a warning, as the last few emails you sent all seem to be like this.

Some of the relevant mail headers from this mail:
Show 17 quoted lines
>Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
>	id S1752826Ab0IXMH3 (ORCPT <rfc822;thleetest9@gmail.com>
>	+ 99 others); Fri, 24 Sep 2010 08:07:29 -0400
>Received: from caprica.metux.de ([82.165.128.25]:38054 "EHLO
>	mailgate.caprica.metux.de" rhost-flags-OK-OK-OK-FAIL)
>	by vger.kernel.org with ESMTP id S1752237Ab0IXMH3 (ORCPT
>	<rfc822;git@vger.kernel.org>); Fri, 24 Sep 2010 08:07:29 -0400
>Received: from mailgate.caprica.metux.de (localhost.localdomain [127.0.0.1])
>	by mailgate.caprica.metux.de (8.14.4/8.14.4) with ESMTP id o8OBuZHp005578;
>	Fri, 24 Sep 2010 14:08:05 +0200
>Received: (from uucp@localhost)
>	by mailgate.caprica.metux.de (8.14.4/8.14.4/Submit) with UUCP id 
>	o8NKgxSa008244; Thu, 23 Sep 2010 22:42:59 +0200
>Received: (from weigelt@localhost)
>	by nibiru.metux.de (8.12.10/8.12.10) id o8L7uL3d031552;
>	Tue, 21 Sep 2010 09:56:21 +0200
>Date:	Tue, 21 Sep 2010 09:56:21 +0200
Tong Sun· Sep 24, 2010, 15:24 UTC · re: Daniel Johnson · lore

Re: Mirror plain directory under git

First of all, thanks a lot Enrico for your answer. I was just about to gave up, and start coding for rcs. Your answer is extremely helpful.

On Fri, Sep 24, 2010 at 10:36 AM, Daniel Johnson <computerdruid@gmail.com> wrote:

> I know nothing about the subject matter of your email, but the date appears to
> be wrong on this email message, hiding it back further in the history than it
> should be. Just a warning, as the last few emails you sent all seem to be like
> this.

Ok, I took the liberty to look into the issue, and it seems that, Enrico, it's your mailgate.caprica.metux.de mail gateway that is causing the delay -- taking 3 days for your email to come out of it:

Received: by x1.dev; 24 Sep 2010 12:07:27 -0000
Received: by 16.mx.develooper.com (qpsmtpd/0.80); Fri, 24 Sep 2010
05:07:22 -0700
Received: by mailgate.caprica.metux.de (8.14.4/8.14.4); Fri, 24 Sep
2010 14:08:05 +0200
Received: (from uucp@localhost) by mailgate.caprica.metux.de
(8.14.4/8.14.4/Submit); Thu, 23 Sep 2010 22:42:59 +0200
Received: (from weigelt@localhost) by nibiru.metux.de
(8.12.10/8.12.10) id o8L7uL3d031552; Tue, 21 Sep 2010 09:56:21 +0200
Date: Tue, 21 Sep 2010 09:56:21 +0200
HTH
Tong
Enrico Weigelt· Sep 24, 2010, 20:20 UTC · re: Tong Sun · lore

Re: Mirror plain directory under git

* Tong Sun <suntong@cpan.org> wrote:
> Ok, I took the liberty to look into the issue, and it seems that,
> Enrico, it's your mailgate.caprica.metux.de mail gateway that is
> causing the delay -- taking 3 days for your email to come out of it:

Yep. I some trouble with my relay - quota was exceeded and so all the mails were stuck in uucp spools instead of being relayed ;-o

cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------

← back to recent threads