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

Re: git as a backup tool?

From
PBPeter Baumann <waste.manager@gmx.de>
Date
May 15, 2007, 05:51 UTC
Message-ID
<20070515055132.GC5493@xp.machine.xx>
In-Reply-To
<c1b8b6670705142209x267e44cbrea26aa8818275aea@mail.gmail.com>
On Tue, May 15, 2007 at 01:09:06PM +0800, Russell wrote:
Show 27 quoted lines
>  On 5/14/07, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> >         Hi,
> >
> > Has anyone considered using git as a backup tool?  I.e.
> >   - put your whole file system in git
> >   - do `git add .; git commit -a' from cron
> >   - copy .git to external media once in a while
> >   - clean up old stuff (unused and older than xx days) from .git
> 
>  I'm using git to backup my private email, all in Maildir format, in
>  that manner.  In addition, I push to a remote bare repository
>  automatically, using ssh host keys.
> 
>  The most annoying issue was trying to prevent spam getting stuck in
>  the mail history.  I do this by having the "unsure" mail folder in a
>  different place, and then having a symlink from the mail store point
>  there so mutt can still find it easily if needed.
> 
>  Backing up a whole home directory would require careful thought about
>  what _not_ to backup, similar to the spam issue.  You probably
>  wouldn't want to backup things that you download off the net and can
>  easily retrieve again, like foo-1.2.tar.gz etc.
> 
>  I'm not sure what you mean by cleaning up old stuff.  git (or at least
>  my usage of it) requires the whole history to be in the repository.  I
>  haven't looked at shallow clones or other ways to prune history.
> 

There was already a discussion about using git for backup in [1], which is probabily worth reading. For cleaning up old history Junio explained a very elegant solution in [2].

-Peter

[1]: http://thread.gmane.org/gmane.comp.version-control.git/33887 [2]: http://article.gmane.org/gmane.comp.version-control.git/34455

Previous: Russell
Message 4 of 4 in “git as a backup tool?”
  1. Geert UytterhoevenMay 14, 2007
  2. Ron ParkerMay 14, 2007
  3. RussellMay 15, 2007
  4. Peter BaumannMay 15, 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.