Bacula-users

Re: [Bacula-users] Backing up a bare git repository in full and incremental mode

2015-02-12 08:31:09
Subject: Re: [Bacula-users] Backing up a bare git repository in full and incremental mode
From: Davide Franco <bacula-dev AT dflc DOT ch>
To: Thorsten Reichelt <bacula-users AT thorsten-reichelt DOT de>
Date: Thu, 12 Feb 2015 13:58:09 +0100
Hi Thorsten,

I'd suggest to create a specific job with as below
Job {
  Name = Backup_Git
  Type = Backup
  Client = yourclient
  Pool = YourPool
  ...
... ClientRunBeforeJob = "/usr/local/sbin/pre-backup-git.sh" }
Create a shell script and configure the Job parameter ClientRunBeforeJob

In the script pre-backup-git.sh, use the command below somewhere and replace the gitrepository

#!/bin/sh
...
somefolder = "/opt/gitbackup"
gitrepository = "/home/myself/git/myrepo"
$ git clone --mirror $gitrepository $somefolder
...

About Full / Incremental backup, If I'm not wrong, you can (on the file level) make an incremental backup but it wouldn't be useful at all.
So my recommandation would be to perform only Full backups on a daily basis.

Hope it would help you

Best regards

Davide

On Thu, Feb 12, 2015 at 8:09 AM, Luc Van der Veken <lucvdv AT wimionline DOT com> wrote:
Have you tried asking in a git forum/list?
There must be some people with knowledge of git that also use bacula, but I would think you'd have more luck there.

Stack overflow is also a good place for all things developer:
http://stackoverflow.com/questions/12129148/incremental-backups-with-git-bundle-for-all-branches


They seem to take an approach of 'to make an incremental backup, git needs access to the previous backup to see what's already in there'.

Someone also suggests --since, but the danger in that is that you risk skipping changes if you don't specify the _exact_ time and date of the previous backup (or earlier). Also, if a backup ever fails, the next one (the next day) will just proceed as if it succeeded.


-----Original Message-----
From: Thorsten Reichelt [mailto:bacula-users AT thorsten-reichelt DOT de]
Sent: 11 February 2015 19:05
To: bacula-users AT lists.sourceforge DOT net
Subject: [Bacula-users] Backing up a bare git repository in full and incremental mode

Hi!

I have to backup one or more bare git repositories but I cannot figure
out whats the best way to do this.

I want to use this backup plan:
Every month => full backup (all branches, tags...)
Every night => incremental backup (changes since last incremental/full)

For that I run a pre-backup script that calls

===
cd $repo
git bundle create /tmp/gitbackups/$repo-all --all
===

for every found repository to perform the monthly full backup.
But I am not shure how to perform an incremental or differential backup
with git. For my SVN repositories I can simply call something like
"svnadmin dump -r 1024 --incremental > /tmp/svnbackups/$repo-inc".

But how to handle this with git?
Maybe I can call "git bundle create --since="yesterday"
/tmp/gitbackups/$repo-inc --all" but seems not to be the same.

Are there any working solutions for this? ;)

Thorsten

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
<Prev in Thread] Current Thread [Next in Thread>