GIT handler
It's awfully simple but i'm right now using this handler to backup my git repositories
setsection git getconf destination getconf repository debug 1 "Repositories to backup :" for r in $repository ; do info "Repository to backup [$r]" done if [ ! $test ]; then mkdir -p $destination cd $destination for r in $repository ; do b=`echo ${r##*/} | sed 's/.git$//'` if [ -d $b ] ; then info "Now updating repository [$r] to [$b]" cd $b git pull exit_status=$? cd .. else info "Now backuping repository [$r] to [$b]" git clone $r exit_status=$? fi if [ $exit_status == 0 ]; then info "success!" else error "failed to backup [$r]" rm -rf $r fi done fi
with configuration
[git] log = /var/log/backupninja/git-backup-github.log destination = /mnt/external/backups/backups/git/github/ repository = https://github.com/user/repo1 repository = https://github.com/user/repo2
Feel free to adapt / enhance it (in addition to the svn/cvs ones)
(from redmine: created on 2012-09-26)