2 HELPERS="$HELPERS rdiff:incremental_remote_filesystem_backup"
5 formBegin "rdiff action wizard"
6 formItem "keep" "$rdiff_keep"
7 formItem "dest_directory" "$rdiff_directory"
8 formItem "dest_host" "$rdiff_host"
9 formItem "dest_user" "$rdiff_user"
24 formBegin "rdiff action wizard: includes"
25 formItem include /var/spool/cron/crontabs
26 formItem include /var/backups
28 formItem include /root
29 formItem include /home
30 formItem include '/usr/local/*bin'
31 formItem include '/var/lib/dpkg/status*'
41 [ "$i" != "" ] && rdiff_includes="$rdiff_includes\ninclude = $i"
45 formBegin "rdiff action wizard: excludes"
46 formItem exclude '/home/*/.gnupg'
55 [ "$i" != "" ] && rdiff_excludes="$rdiff_excludes\nexclude = $i"
64 if [ "$_dest_done" = "" ]; then
65 msgBox "rdiff action wizard: error" "You must first configure the destination"
68 booleanBox "rdiff action wizard" "This step will create a ssh key for the local root user with no passphrase (if one does not already exist), and attempt to copy root's public ssh key to authorized_keys file of $rdiff_user@$rdiff_host. This will allow the local root to make unattended backups to $rdiff_user@$rdiff_host. Are you sure you want to continue?"
72 if [ ! -f /root/.ssh/id_dsa.pub -a ! -f /root/.ssh/id_rsa.pub ]; then
73 echo "Creating local root's ssh key"
74 ssh-keygen -t dsa -f /root/.ssh/id_dsa -N ""
75 echo "Done. hit return to continue"
79 ssh -o PreferredAuthentications=publickey $rdiff_host -l $rdiff_user "exit" 2> /dev/null
81 echo "Copying root's public ssh key to authorized_keys of $rdiff_user@$rdiff_host. Specify the password for user $rdiff_user@$rdiff_host."
82 ssh-copy-id -i /root/.ssh/id_[rd]sa.pub $rdiff_user@$rdiff_host
84 msgBox "rdiff action wizard: error" "Failed to connect to $rdiff_user@$rdiff_host. Make sure you have the username and password correct."
87 echo "Done. hit return to continue"
91 echo "root@localhost is already in authorized_keys of $rdiff_user@$rdiff_host. hit return to continue"
99 get_next_filename $configdirectory/90.rdiff
100 cat > $next_filename <<EOF
102 # when = everyday at 02
108 echo -n -e "$rdiff_includes" >> $next_filename
109 echo -e "$rdiff_excludes" >> $next_filename
110 cat >> $next_filename <<EOF
114 directory = $rdiff_directory
118 chmod 000 $next_filename
123 srcitem="choose files to include & exclude $_src_done"
124 destitem="configure backup destination $_dest_done"
125 conitem="set up ssh keys and test remote connection $_con_done"
126 advitem="edit advanced settings $_adv_done"
127 menuBox "rdiff action wizard" "choose a step:" \
131 finish "finish and create config file"
132 [ $? = 1 ] && return;
135 "src") do_rdiff_src;;
136 "dest") do_rdiff_dest;;
137 "conn") do_rdiff_con;;
138 "adv") do_rdiff_adv;;
140 if [[ "$_con_done$_dest_done$_src_done" != "(DONE)(DONE)(DONE)" ]]; then
141 msgBox "rdiff action wizard" "You cannot create the configuration file until the other steps are completed."
153 # require_packages rdiff-backup
159 rdiff_directory=/backup/`hostname`