~ubuntu-branches/ubuntu/edgy/backupninja/edgy

« back to all changes in this revision

Viewing changes to handlers/dup

  • Committer: Bazaar Package Importer
  • Author(s): Micah Anderson
  • Date: 2005-12-29 14:21:48 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20051229142148-r76d1ceay4vh1zxl
Tags: 0.9.2-1
New upstream release
. Update backupninja.conf.5 man page to include "when" 
and "vservers" (Closes: #338512)
. Updated debian/control to Depend: on bash (Closes: #338795)
. Fixed broken toint() causing backups not to run when set to "everyday"
(Closes: #341881)
. Trac handler mkdir subdirectory problem fixed (Closes: #344156)
. Ninjahelper rdiff-backup fixes
. Linux-Vserver related functions added for ninjahelper
. New Linux-Vserver related functions added to dup and pgsql helpers
. Code re-factoring to make shared functions more available
. Pgsql and mysql helper bugfixes
. Duplicity handler fixed globbing support in include and exclude options
(Closes: #338796)
. Duplicity ninjahelper added (Closes: #340640)
. Ninjahelper man page added (Closes: #341239)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
1
2
#
2
3
# duplicity script for backupninja
3
4
# requires duplicity
11
12
getconf password
12
13
getconf sign no
13
14
getconf encryptkey
 
15
getconf signkey
14
16
 
15
17
setsection source
16
18
getconf include
30
32
 
31
33
[ "$destdir" != "" ] || fatal "Destination directory not set"
32
34
[ "$include" != "" ] || fatal "No source includes specified"
33
 
[ "$password" != "" ] || fatal "No password specified"
34
35
 
35
36
### vservers stuff ###
36
37
 
79
80
 
80
81
execstr="$options --no-print-statistics --scp-command 'scp $scpoptions' --ssh-command 'ssh $sshoptions' "
81
82
 
82
 
if [ "$encryptkey" == "" ]; then
83
 
    [ "$sign" != "yes" ] || fatal "encryptkey option must be set when signing."
84
 
else
 
83
# deal with symmetric or asymmetric (public/private key pair) encryption
 
84
if [ -n "$encryptkey" ]; then
85
85
    execstr="${execstr}--encrypt-key $encryptkey "
86
 
    [ "$sign" != "yes" ] || execstr="${execstr}--sign-key $encryptkey "
 
86
    debug "Data will be encrypted with the GnuPG key $encryptkey."
 
87
else
 
88
    [ -n "$password" ] || fatal "The password option must be set when using symmetric encryption."
 
89
    debug "Data will be encrypted using symmetric encryption."
 
90
fi
 
91
 
 
92
# deal with data signing
 
93
if [ "$sign" == yes ]; then
 
94
    # duplicity is not able to sign data when using symmetric encryption
 
95
    [ -n "$encryptkey" ] || fatal "The encryptkey option must be set when signing."
 
96
    # if needed, initialize signkey to a value that is not empty (checked above)
 
97
    [ -n "$signkey" ] || signkey="$encryptkey"
 
98
    # check password validity
 
99
    [ -n "$password" ] || fatal "The password option must be set when signing."
 
100
    execstr="${execstr}--sign-key $signkey "
 
101
    debug "Data will be signed will the GnuPG key $signkey."
 
102
else
 
103
    debug "Data won't be signed."
87
104
fi
88
105
 
89
106
if [ "$keep" != "yes" ]; then
105
122
# excludes
106
123
for i in $exclude; do
107
124
        str="${i//__star__/*}"
108
 
        execstr="${execstr}--exclude $str "
 
125
        execstr="${execstr}--exclude '$str' "
109
126
done
110
127
        
111
128
# includes 
112
129
for i in $include; do
113
130
        str="${i//__star__/*}"
114
 
        execstr="${execstr}--include $str "
 
131
        execstr="${execstr}--include '$str' "
115
132
done
116
133
 
117
134
# vsincludes