2 # duplicity script for backupninja
16 [ "$destdir" != "" ] || fatal "Destination directory not set"
17 [ "$include" != "" ] || fatal "No source includes specified"
18 [ "$password" != "" ] || fatal "No password specified"
21 debug "ssh -o PasswordAuthentication=no $desthost -l $destuser 'echo -n 1'"
23 result=`ssh -o PasswordAuthentication=no $desthost -l $destuser 'echo -n 1' 2>&1`
24 if [ "$result" != "1" ]; then
25 fatal "Can't connect to $desthost as $destuser."
29 if [ "`echo $keep | tr -d 0-9`" == "" ]; then
33 execstr_serverpart="scp://$destuser@$desthost/$destdir"
34 execstr_clientpart="/"
35 execstr="$options --no-print-statistics --remove-older-than $keep "
39 str="${i//__star__/*}"
40 execstr="${execstr}--exclude $str "
45 str="${i//__star__/*}"
46 execstr="${execstr}--include $str "
49 # exclude everything else, start with root
50 #execstr="${execstr}--exclude '**' / "
52 # include client-part and server-part
53 #execstr="$execstr $execstr_serverpart"
55 execstr=${execstr//\\*/\\\\\\*}
57 debug "duplicity $execstr --exclude '**' / $execstr_serverpart"
61 output=`duplicity $execstr --exclude '**' / $execstr_serverpart 2>&1`
63 if [ "$code" == "0" ]; then
65 info "Duplicity finished successfully."
68 warning "Duplicity failed."