sauvegardes/Plan Borg/bin/dobackup-remote

33 lines
668 B
Bash
Executable File

#!/bin/bash
help()
{
echo "Usage: dobackup-remote [ -h | -help | --help | <COMPUTER> ]"
echo "Trigger backup on remote machine."
}
#
help=0
if (( $# != 1)); then
help=1
elif [ "$parameter" == "-h" ] || [ "$parameter" == "-help" ] || [ "$parameter" == "--help" ]; then
help=1
fi
if (( $help )); then
help
else
COMPUTER="$1"
echo "===== $COMPUTER ====="
# Fix repo owner.
BORG_REPO="/var/backups/borg/${COMPUTER}.repo"
chown -R borg.borg $BORG_REPO
# Trigger remote backup.
REMOTE_USER="admin666"
ssh ${REMOTE_USER}@${COMPUTER} "sudo borgmatic create $OPTIONS --stats --verbosity 1 --syslog-verbosity 1"
fi