list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <>
To: "Ævar Arnfjörð Bjarmason" <>
Cc: Guilhem Bonnefille <>,
	Git List <>
Subject: Re: How to efficiently backup a bare repository?
Date: Sun, 25 Nov 2018 10:16:25 +0900	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <> (=?utf-8?B?IsOGdmFyIEFy?= =?utf-8?B?bmZqw7Zyw7A=?= Bjarmason"'s message of "Sat, 24 Nov 2018 23:44:37 +0100")

Ævar Arnfjörð Bjarmason <> writes:

> There's no easy out of the box way to do exactly what you've
> described. A few things come to mind:
> ...

Wouldn't it suffice to have a cron job that runs something like

	D=$(date +"%Y-%m-%d")
	git fetch $serving "refs/*:refs/backup-$D/*"

on the back-up box to fetch from the repository on the box the
end-users push into once a day?  In the back-up repository, the
refs/backup-2018-11-25/heads/master reference would be today's tip
of the master branch of the serving repository.  You can set the
expiry timeout to "now" (i.e. "gc" will immediately drop unreachable
objects, and that is fine because you expicitly have refs to pin
these objects anyway), get the dedup from "git fetch" for free,
repack the backup repository as a whole, and dropping the whole
refs/backup-2018-10-25/* hierarcy on 2018-11-25 is all you need to
expire the refs.

You may want to play with the ref-advertisement limiting options in
the recent Git, if it is too much to grow the amount of "have"s by
30x for the common ancestry negotiation.  But that is a small
implementation detail.

      reply	other threads:[~2018-11-25  1:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-23 10:23 Guilhem Bonnefille
2018-11-24 22:44 ` Ævar Arnfjörð Bjarmason
2018-11-25  1:16   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: How to efficiently backup a bare repository?' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).