2023-03-17 17:10:38 +01:00
|
|
|
#!/bin/bash
|
2023-01-16 19:44:21 +01:00
|
|
|
|
|
|
|
help()
|
|
|
|
{
|
|
|
|
echo "Usage: dobackup-rsync [ -h | -help | --help | <MACHINE> ]"
|
|
|
|
echo "Rsync remote before backup it."
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
help=0
|
|
|
|
if (( $# != 1)); then
|
|
|
|
help=1
|
|
|
|
elif [ "$parameter" == "-h" ] || [ "$parameter" == "-help" ] || [ "$parameter" == "--help" ]; then
|
|
|
|
help=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if (( $help )); then
|
|
|
|
help
|
|
|
|
else
|
2023-03-17 01:06:47 +01:00
|
|
|
COMPUTER="$1"
|
2023-01-16 19:44:21 +01:00
|
|
|
REMOTE_USER=admin666
|
|
|
|
echo "===== $COMPUTER ====="
|
2023-03-17 01:06:47 +01:00
|
|
|
CONFIG="/etc/borgmatic.d/$COMPUTER.yaml"
|
2023-01-16 19:44:21 +01:00
|
|
|
if [ -f "$CONFIG" ]; then
|
|
|
|
borgmatic -c $CONFIG create $OPTIONS --stats --verbosity 1 --syslog-verbosity 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|