aboutsummaryrefslogtreecommitdiff
path: root/app/backup/backupninja/backupninja-0.9.3.diff
blob: 101303ac917354f16646a4db46eab2b6f171a5b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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