diff options
author | Elijah Saxon <elijah@riseup.net> | 2005-07-04 06:39:00 +0000 |
---|---|---|
committer | Elijah Saxon <elijah@riseup.net> | 2005-07-04 06:39:00 +0000 |
commit | 4c8e2839949be4603fbb8fb9e7a7e536e59c1dc4 (patch) | |
tree | 97f709c75eb39f15a7c29dfcfe11cb0ac0a15853 /handlers/rdiff.helper | |
parent | 2046272df5e3efeb8c6174b77c807ed40a2e3bd1 (diff) | |
download | backupninja-4c8e2839949be4603fbb8fb9e7a7e536e59c1dc4.tar.gz backupninja-4c8e2839949be4603fbb8fb9e7a7e536e59c1dc4.tar.bz2 |
created ninjahelper
Diffstat (limited to 'handlers/rdiff.helper')
-rw-r--r-- | handlers/rdiff.helper | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/handlers/rdiff.helper b/handlers/rdiff.helper new file mode 100644 index 0000000..1364367 --- /dev/null +++ b/handlers/rdiff.helper @@ -0,0 +1,69 @@ + +rdiff_wizard() { + require_packages rdiff-backup + startForm "rdiff action wizard" + formItem "keep" "60D" + formItem "dest_directory" "/backups/mybackup" + formItem "dest_host" "backuphost" + formItem "dest_user" "backupuser" + displayForm + + [ $? = 1 ] && return; + + set -- $REPLY + keep=$1 + directory=$2 + host=$3 + user=$4 + + startForm "rdiff action wizard: includes" + formItem include /var/spool/cron/crontabs + formItem include /var/backups + formItem include /etc + formItem include /root + formItem include /home + formItem include /usr/local/__star__bin + formItem include /var/lib/dpkg/status__star__ + formItem include + formItem include + formItem include + displayForm + + [ $? = 1 ] && return; + + includes= + for i in $REPLY; do + [ "$i" != "_empty_" ] && includes="$includes\ninclude = $i" + done + + startForm "rdiff action wizard: excludes" + formItem exclude /home/__star__/.gnupg + formItem exclude + formItem exclude + displayForm + + [ $? = 1 ] && return; + + excludes= + for i in $REPLY; do + [ "$i" != "_empty_" ] && excludes="$excludes\nexclude = $i" + done + + get_next_filename $configdirectory/90.rdiff + cat > $next_filename <<EOF +[source] +type = local +keep = $keep +EOF + echo -e $includes >> $next_filename + echo -e $excludes >> $next_filename + cat >> $next_filename <<EOF + +[dest] +type = remote +directory = $directory +host = $host +user = $user +EOF + chmod 000 $next_filename +} |