sauvegardes/Plan Borg/bin/doinit

30 lines
495 B
Bash
Executable File

#!/bin/bash
help()
{
echo "Usage: doinit [ -h | -help | --help | <MACHINE> ]"
echo "Init a borg repository."
}
#
help=0
if (( $# != 1)); then
help=1
else
for parameter in $@; do
if [ "$parameter" == "-h" ] || [ "$parameter" == "-help" ] || [ "$parameter" == "--help" ]; then
help=1
fi
done
fi
if (( $help )); then
help
else
COMPUTER="$1"
borgmatic -c /etc/borgmatic.d/${COMPUTER}.yaml init --encryption=repokey-blake2
fi