Caminhos errados com backupninja

0

Estou tentando configurar backups automáticos dos meus repositórios svn com a ajuda do backupninja, mas parece que os caminhos usados ao executar o script svn-hot-backup.py estão errados. ( svn-hot-backup.py é o% cop_de% copiado e colado de aqui desde que eu não pude encontrá-lo incluído no dist raspbian)

Este é o começo do arquivo de log:

Apr 07 18:05:32 Debug: check_perms /etc/backup.d
Apr 07 18:05:32 Debug: perms: drwxrwx---
Apr 07 18:05:32 Debug: gperm: rwx
Apr 07 18:05:32 Debug: wperm: ---
Apr 07 18:05:32 Debug: check_perms /etc/backup.d/etherealcode.svn
Apr 07 18:05:32 Debug: perms: -rw-r-----
Apr 07 18:05:32 Debug: gperm: r--
Apr 07 18:05:32 Debug: wperm: ---
Apr 07 18:05:32 Info: >>>> starting action /etc/backup.d/etherealcode.svn (because of --now)
Apr 07 18:05:32 Debug: yes
Apr 07 18:05:32 Debug: executing handler in locked section controlled by /var/lock/backupninja/_etc_backup.d_etherealcode.svn
Apr 07 18:05:33 Debug: [Errno 2] No such file or directory
Beginning hot backup of '/mnt/data/svnrepos/./etherealdesign'.
Apr 07 18:05:33 Error: command failed -- /usr/share/subversion/svn-hot-backup.py /mnt/data/svnrepos/./etherealdesign /var/backups/svn.tmp/./etherealdesign

Este é o meu arquivo hot-backup.py :

##
## Perform a hot backup of subversion repositories.
##
## REQUIRES: apt-get install subversion-tools
##
## This file can be empty, the defaults are usually good.
##

when = sunday at 02:00

## where subversion data lives
src = /mnt/data/svnrepos

## where to save the backups to
dest = /mnt/backup/data/svnrepos

## where to save temporary backups
## (if successful, $tmp is moved to $dest)
#tmp = /tmp/svn.tmp

## the hotbackup program to use.
HOTBACKUP = /usr/share/subversion/svn-hot-backup.py

## the name of the vserver containing svn, if using vservers
# vsname =

Como você pode ver, há um /etc/backup.d/action.svn extra no caminho para o repositório. Este é um bug conhecido ou há algo errado em meus arquivos de configuração?

Consegui encontrar este script aqui ./ , mas não tenho ideia se é isso que cria os caminhos defeituosos:

# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
#
# this handler will backup subversion repostitories.
#

getconf src /var/lib/svn
getconf dest /var/backups/svn
getconf tmp /var/backups/svn.tmp
getconf HOTBACKUP "/usr/bin/svnadmin hotcopy"
getconf vsname

error=0

# Decide if the handler should operate on a vserver or on the host.
# In the former case, check that $vsname exists and is running.
usevserver=no
vroot=''
if [ $vservers_are_available = yes ]; then
   if [ -n "$vsname" ]; then
      # does it exist ?
      if ! vservers_exist "$vsname" ; then
         fatal "The vserver given in vsname ($vsname) does not exist."
      fi
      # is it running ?
      vservers_running $vsname || fatal "The vserver $vsname is not running."
      # everything ok
      info "Using vserver '$vsname'."
      usevserver=yes
      vroot="$VROOTDIR/$vsname"
   else
      info "No vserver name specified, actions will be performed on the host."
   fi
fi

cd $vroot$src
for repo in 'find . -name svnserve.conf'
do
   repo='dirname $repo'
   repo='dirname $repo'

   ret='mkdir -p $vroot$tmp/$repo 2>&1'
   code=$?
   if [ "$ret" ]; then
      debug "$ret"
   fi
   if [ $code != 0 ]; then
      error "command failed mkdir -p $vroot$tmp/$repo"
   fi

   if [ $usevserver = yes ]
   then
      ret='$VSERVER $vsname exec $HOTBACKUP $src/$repo $tmp/$repo 2>&1'
   else
      ret='$HOTBACKUP $src/$repo $tmp/$repo 2>&1'
   fi
   code=$?
   if [ "$ret" ]; then
      debug "$ret"
   fi
   if [ $code != 0 ]; then
      error "command failed -- $HOTBACKUP $vroot$src/$repo $vroot$tmp/$repo"
      error=1
   fi
done

if [ $error -eq 1 ]; then
   echo "Error: because of earlier errors, we are leaving svn backups in $vroot$tmp instead of $vroot$dest"
else
   if [ -d $vroot$dest -a -d $vroot$tmp ]; then
      rm -rf $vroot$dest
   fi
   if [ -d $vroot$tmp ]; then
      mv $vroot$tmp $vroot$dest
   fi
fi

exit 0
    
por MoonSire 07.04.2013 / 18:28

1 resposta

0

Para corrigir, adicionei

repo='basename $repo'

logo abaixo das linhas:

repo='dirname $repo'
repo='dirname $repo'

em /usr/share/backupninja/svn

Também adicionei um relatório de erros ao site oficial

    
por 15.04.2013 / 07:53