backupninja issueshttps://0xacab.org/liberate/backupninja/-/issues2018-06-29T21:07:31Zhttps://0xacab.org/liberate/backupninja/-/issues/4061GIT handler2018-06-29T21:07:31ZGhost UserGIT handlerIt's awfully simple but i'm right now using this handler to backup my git repositories
<pre>
setsection git
getconf destination
getconf repository
debug 1 "Repositories to backup :"
for r in $repository ; do
info "Repository...It's awfully simple but i'm right now using this handler to backup my git repositories
<pre>
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
</pre>
with configuration
<pre>
[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
</pre>
Feel free to adapt / enhance it (in addition to the svn/cvs ones)
*(from redmine: created on 2012-09-26)*