X-Git-Url: https://codewiz.org/gitweb?p=wizbackup.git;a=blobdiff_plain;f=wizbackup;h=b0a74a323d0bffe90b26921513f1509cff196aaa;hp=c88cc7e11861aae6220690401a0dadec5f8e302f;hb=c02953445f24eaa776092b516abe9e8be33c0149;hpb=7c061b438673833744dc9c3db70ed82d1d5c00db diff --git a/wizbackup b/wizbackup index c88cc7e..b0a74a3 100755 --- a/wizbackup +++ b/wizbackup @@ -1,10 +1,10 @@ #!/bin/bash # -# WizBackup 2.0 - Simple rsync backup with snapshots +# WizBackup 3.0 - Simple rsync backup with snapshots # Based on incremental-backup 0.1 by Matteo Mattei # # Copyright 2006 Matteo Mattei -# Copyright 2007, 2008, 2009, 2010, 2011, 2015 Bernie Innocenti +# Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2015 Bernie Innocenti # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -38,6 +38,8 @@ SRC=$1; shift # Destination directory (will be created if it doesn't exist) DEST=$1; shift +CONF_FILE="/etc/wizbackup/wizbackup.conf" + # NOTE: --timeout needs to be large enough: if a large dir tree don't change a lot of time can pass without I/O # NOTE: --inplace will clobber linked files in older snapshots. DON'T USE IT! RSYNC_OPTS="-HAXa --stats --timeout 1800 --numeric-ids --delete --delete-excluded --ignore-errors $@" @@ -57,12 +59,15 @@ elif [ $(date +"%w") = 0 ]; then fi DEST="`echo $DEST | sed -e 's/\/$//'`" +if [ -f "$CONF_FILE" ]; then + source /etc/wizbackup/wizbackup.conf +fi # Use "backup" ssh key with ssh protocol, or password file for rsync protocol if [ "${SRC%:*}" == "rsync" ]; then RSYNC_OPTS="$RSYNC_OPTS --password-file=/etc/wizbackup/rsync_password --contimeout 10" else - export RSYNC_RSH="ssh -i /etc/wizbackup/ssh_id -c arcfour -x -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no" + export RSYNC_RSH="ssh -i /etc/wizbackup/ssh_id -x -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no" fi # Error tolerant grep @@ -168,7 +173,7 @@ do_test() { # make sure to be root if (( `id -u` != 0 )); then { echo "Sorry, must be root. Exiting..."; exit; } fi -echo "$(date): BEGIN backup: $SRC -> $DEST" +echo "$(date): BEGIN backup: $0 $@" echo "$(date): $0 $SRC $DEST $@" do_init do_prune 6 ""