From 24504907a983f07cf4de2d1938e8fd3d884ee623 Mon Sep 17 00:00:00 2001 From: rhatto Date: Sat, 13 Sep 2008 13:28:19 +0000 Subject: backupninja: upgraded to 0.9.6 git-svn-id: svn+slack://slack.fluxo.info/var/svn/mkbuilds@237 18ef50b8-d735-4ccd-97c1-689132df3dd9 --- app/backup/backupninja/backupninja-0.9.3.diff | 133 ++++++++++++++++++++ app/backup/backupninja/backupninja-0.9.4.diff | 173 ++++++++++++++++++++++++++ app/backup/backupninja/backupninja-0.9.5.diff | 113 +++++++++++++++++ app/backup/backupninja/backupninja-0.9.6.diff | 112 +++++++++++++++++ app/backup/backupninja/backupninja.mkbuild | 2 +- 5 files changed, 532 insertions(+), 1 deletion(-) create mode 100644 app/backup/backupninja/backupninja-0.9.3.diff create mode 100644 app/backup/backupninja/backupninja-0.9.4.diff create mode 100644 app/backup/backupninja/backupninja-0.9.5.diff create mode 100644 app/backup/backupninja/backupninja-0.9.6.diff (limited to 'app/backup') diff --git a/app/backup/backupninja/backupninja-0.9.3.diff b/app/backup/backupninja/backupninja-0.9.3.diff new file mode 100644 index 0000000..101303a --- /dev/null +++ b/app/backup/backupninja/backupninja-0.9.3.diff @@ -0,0 +1,133 @@ +diff -Naur backupninja-0.9.3.orig/handlers/makecd backupninja-0.9.3/handlers/makecd +--- backupninja-0.9.3.orig/handlers/makecd 2005-12-28 18:19:29.000000000 -0200 ++++ backupninja-0.9.3/handlers/makecd 2006-09-19 17:26:11.000000000 -0300 +@@ -10,6 +10,7 @@ + getconf isoonly yes + getconf imagefile backup.iso + getconf device ++getconf nicelevel 0 + + # define needed executables: + MKISOFS="/usr/bin/mkisofs" +@@ -35,7 +36,7 @@ + fi + + outputfile="$backupdir/$imagefile" +-execstr="$MKISOFS --quiet -R -o $outputfile " ++execstr="nice -n $nicelevel $MKISOFS --quiet -R -o $outputfile " + + str="" + # excludes +diff -Naur backupninja-0.9.3.orig/handlers/mysql backupninja-0.9.3/handlers/mysql +--- backupninja-0.9.3.orig/handlers/mysql 2006-01-19 19:58:56.000000000 -0200 ++++ backupninja-0.9.3/handlers/mysql 2006-09-19 17:22:49.000000000 -0300 +@@ -24,7 +24,7 @@ + local usevserver=no + local vroot + if [ $vservers_are_available = yes ]; then +- if [ -z "$vsname" ]; then ++ if [ ! -z "$vsname" ]; then + # does it exist ? + if ! vservers_exist "$vsname" ; then + fatal "The vserver given in vsname ($vsname) does not exist." +@@ -75,7 +75,7 @@ + # 1. setting the user, so that /home/user/.my.cnf is used. + # 2. specifying the user and password in the handler config, + # which generates a temporary .my.cnf in /root/.my.cnf +-# 3. specify the config file with --defaults-file ++# 3. specify the config file with --defaults-extra-file + # (this option DOESN'T WORK WITH MYSQLHOTCOPY) + # + +@@ -130,16 +130,16 @@ + umask $oldmask + if [ $usevserver = yes ] + then +- defaultsfile="--defaults-file=$vhome/.my.cnf" ++ defaultsfile="--defaults-extra-file=$vhome/.my.cnf" + else +- defaultsfile="--defaults-file=$mycnf" ++ defaultsfile="--defaults-extra-file=$mycnf" + fi + fi + + # if a user is not set, use $configfile, otherwise use $mycnf + if [ "$user" == "" ]; then + user=root; +- defaultsfile="--defaults-file=$configfile" ++ defaultsfile="--defaults-extra-file=$configfile" + else + userset=true; + if [ $usevserver = yes ] +@@ -160,7 +160,7 @@ + + debug "User home set to: $userhome" + [ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf" +- defaultsfile="--defaults-file=$vuserhome/.my.cnf" ++ defaultsfile="--defaults-extra-file=$vuserhome/.my.cnf" + debug "using $defaultsfile" + fi + +diff -Naur backupninja-0.9.3.orig/handlers/rdiff backupninja-0.9.3/handlers/rdiff +--- backupninja-0.9.3.orig/handlers/rdiff 2006-01-31 15:35:46.000000000 -0200 ++++ backupninja-0.9.3/handlers/rdiff 2006-09-19 17:22:49.000000000 -0300 +@@ -17,8 +17,8 @@ + fi + local user=$1 + local host=$2 +- debug "ssh -o PasswordAuthentication=no $host -l $user 'echo -n 1'" +- local ret=`ssh -o PasswordAuthentication=no $host -l $user 'echo -n host is alive'` ++ debug "ssh $sshoptions -o PasswordAuthentication=no $host -l $user 'echo -n 1'" ++ local ret=`ssh $sshoptions -o PasswordAuthentication=no $host -l $user 'echo -n host is alive'` + if echo $ret | grep "host is alive"; then + debug "Connected to $host as $user successfully" + else +@@ -36,8 +36,8 @@ + else + local user=$1 + local host=$2 +- debug "ssh $host -l $user '$RDIFFBACKUP -V'" +- echo `ssh $host -l $user "$RDIFFBACKUP -V | grep rdiff-backup"` ++ debug "ssh $sshoptions $host -l $user '$RDIFFBACKUP -V'" ++ echo `ssh $sshoptions $host -l $user "$RDIFFBACKUP -V | grep rdiff-backup"` + fi + } + +@@ -89,6 +89,7 @@ + getconf type; desttype=$type + getconf user; destuser=$user + getconf host; desthost=$host ++getconf sshoptions + check_consistency "destination" "$type" "$user" "$host" + + ### CHECK CONFIG ### +@@ -147,7 +148,7 @@ + keep="${keep}D" + fi + +-removestr="$RDIFFBACKUP --force --remove-older-than $keep " ++removestr="$RDIFFBACKUP $options --force --remove-older-than $keep " + if [ "$desttype" == "remote" ]; then + removestr="${removestr}${destuser}@${desthost}::" + fi +@@ -155,7 +156,7 @@ + + debug "$removestr" + if [ ! $test ]; then +- output=`$removestr 2>&1` ++ output="`su -c "$removestr" 2>&1`" + if [ $? = 0 ]; then + debug $output + info "Removing backups older than $keep days succeeded." +diff -Naur backupninja-0.9.3.orig/src/backupninja.in backupninja-0.9.3/src/backupninja.in +--- backupninja-0.9.3.orig/src/backupninja.in 2006-01-17 20:22:52.000000000 -0200 ++++ backupninja-0.9.3/src/backupninja.in 2006-09-19 17:22:49.000000000 -0300 +@@ -500,7 +500,7 @@ + echo ${messages[$i]} + done + echo -e "$errormsg" +- } | mail $reportemail -s "backupninja: $hostname $subject" ++ } | mail -s "backupninja: $hostname $subject" $reportemail + fi + + if [ $actions_run != 0 ]; then diff --git a/app/backup/backupninja/backupninja-0.9.4.diff b/app/backup/backupninja/backupninja-0.9.4.diff new file mode 100644 index 0000000..ea3a62b --- /dev/null +++ b/app/backup/backupninja/backupninja-0.9.4.diff @@ -0,0 +1,173 @@ +diff -Naur backupninja-0.9.4.orig/handlers/mysql backupninja-0.9.4/handlers/mysql +--- backupninja-0.9.4.orig/handlers/mysql 2006-10-07 01:45:20.000000000 -0300 ++++ backupninja-0.9.4/handlers/mysql 2007-01-18 14:24:46.000000000 -0200 +@@ -90,8 +90,7 @@ + then + if [ $usevserver = yes ] + then +- vhome=`$VSERVER $vsname exec getent passwd "root" | awk -F: '{print $6}'` +- home="$vroot$vhome" ++ home=`$VSERVER $vsname exec getent passwd "root" | awk -F: '{print $6}'` + else + home=`getent passwd "root" | awk -F: '{print $6}'` + fi +@@ -99,18 +98,25 @@ + [ -d $home ] || fatal "Can't find root's home directory ($home)." + + mycnf="$home/.my.cnf" +- +- if [ -f $mycnf ] ++ ++ if [ $usevserver = yes ] ++ then ++ workcnf="$vroot$mycnf" ++ else ++ workcnf="$mycnf" ++ fi ++ ++ if [ -f $workcnf ] + then +- # rename temporarily +- tmpcnf="$home/my.cnf.disable" +- debug "mv $mycnf $tmpcnf" +- mv $mycnf $tmpcnf ++ # rename temporarily ++ tmpcnf="$workcnf.disable" ++ debug "mv $workcnf $tmpcnf" ++ mv $workcnf $tmpcnf + fi + + oldmask=`umask` + umask 077 +- cat > $mycnf < $workcnf < $backupdir/${vsname}.sql.gz\"" ++ execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP > $backupdir/${vsname}.sql.gz\"" + else +- execstr="$VSERVER $vsname exec su - postgres -c \"$PGSQLDUMPALL > $backupdir/${vsname}.sql\"" ++ execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL > $backupdir/${vsname}.sql\"" + fi + else + if [ "$compress" == "yes" ]; then +- execstr="su - postgres -c \"$PGSQLDUMPALL | $GZIP > $backupdir/${localhost}-all.sql.gz\"" ++ execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP > $backupdir/${localhost}-all.sql.gz\"" + else +- execstr="su - postgres -c \"$PGSQLDUMPALL > $backupdir/${localhost}-all.sql\"" ++ execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL > $backupdir/${localhost}-all.sql\"" + fi + fi + debug "$execstr" +@@ -106,15 +106,15 @@ + for db in $databases; do + if [ $usevserver = yes ]; then + if [ "$compress" == "yes" ]; then +- execstr="$VSERVER $vsname exec su - postgres -c \"$PGSQLDUMP $db | $GZIP > $backupdir/${db}.sql.gz\"" ++ execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP > $backupdir/${db}.sql.gz\"" + else +- execstr="$VSERVER $vsname exec su - postgres -c \"$PGSQLDUMP $db | > $backupdir/${db}.sql\"" ++ execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | > $backupdir/${db}.sql\"" + fi + else + if [ "$compress" == "yes" ]; then +- execstr="su - postgres -c \"$PGSQLDUMP $db | $GZIP > $backupdir/${db}.sql.gz\"" ++ execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP > $backupdir/${db}.sql.gz\"" + else +- execstr="su - postgres -c \"$PGSQLDUMP $db > $backupdir/${db}.sql\"" ++ execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db > $backupdir/${db}.sql\"" + fi + fi + debug "$execstr" +diff -Naur backupninja-0.9.4.orig/src/backupninja.in backupninja-0.9.4/src/backupninja.in +--- backupninja-0.9.4.orig/src/backupninja.in 2006-10-07 01:45:20.000000000 -0300 ++++ backupninja-0.9.4/src/backupninja.in 2007-01-18 14:09:22.000000000 -0200 +@@ -442,6 +442,7 @@ + getconf MYSQLDUMP /usr/bin/mysqldump + getconf PGSQLDUMP /usr/bin/pg_dump + getconf PGSQLDUMPALL /usr/bin/pg_dumpall ++getconf PGSQLUSER postgres + getconf GZIP /bin/gzip + getconf RSYNC /usr/bin/rsync + getconf admingroup root diff --git a/app/backup/backupninja/backupninja-0.9.5.diff b/app/backup/backupninja/backupninja-0.9.5.diff new file mode 100644 index 0000000..a9e924a --- /dev/null +++ b/app/backup/backupninja/backupninja-0.9.5.diff @@ -0,0 +1,113 @@ +diff -Naur backupninja-0.9.5.orig/handlers/mysql.in backupninja-0.9.5/handlers/mysql.in +--- backupninja-0.9.5.orig/handlers/mysql.in 2007-11-19 23:28:49.000000000 -0200 ++++ backupninja-0.9.5/handlers/mysql.in 2007-12-18 20:09:48.000000000 -0200 +@@ -91,8 +91,7 @@ + then + if [ $usevserver = yes ] + then +- vhome=`$VSERVER $vsname exec getent passwd "root" | @AWK@ -F: '{print $6}'` +- home="$vroot$vhome" ++ home=`$VSERVER $vsname exec getent passwd "root" | @AWK@ -F: '{print $6}'` + else + home=`getent passwd "root" | @AWK@ -F: '{print $6}'` + fi +@@ -100,18 +99,25 @@ + [ -d $home ] || fatal "Can't find root's home directory ($home)." + + mycnf="$home/.my.cnf" +- +- if [ -f $mycnf ] ++ ++ if [ $usevserver = yes ] ++ then ++ workcnf="$vroot$mycnf" ++ else ++ workcnf="$mycnf" ++ fi ++ ++ if [ -f $workcnf ] + then +- # rename temporarily +- tmpcnf="$home/my.cnf.disable" +- debug "mv $mycnf $tmpcnf" +- mv $mycnf $tmpcnf ++ # rename temporarily ++ tmpcnf="$workcnf.disable" ++ debug "mv $workcnf $tmpcnf" ++ mv $workcnf $tmpcnf + fi + + oldmask=`umask` + umask 077 +- cat > $mycnf < $workcnf < $mycnf < $workcnf <