#!/bin/sh ## # Wilfredo Sanchez # Andrew Nesbitt # # Sends backups to a backup server. ## . "$(dirname "$0")/common.sh"; client_load_config; # FIXME: Make this a command line option. verbose="false"; # # Verify SSH keys are set up # if [ ! -f "${client_key_file}" ]; then error "No client private key file: ${client_key_file}"; exit 1; fi; if [ ! -f "${server_pub_file}" ]; then error "No server public key file: ${server_pub_file}"; exit 1; fi; ssh_config_file="$(mktemp -t backup)"; cat > "${ssh_config_file}" < /dev/null 2>&1; then if [ $? -ne 0 ] && \ [ \ $( \ egrep -v \ '(^file has vanished: |^send_files failed to open |^rsync error: some files could not be transferred)' \ "${output}" \ ) -ne 0 \ ]; then echo "WARNING: Errors while backing up data for ${source}:"; cat "${output}"; echo ""; fi; fi; rm -f "${output}"; done; rm "${ssh_config_file}";