28 lines
490 B
Bash
28 lines
490 B
Bash
#!/bin/bash
|
|
|
|
help()
|
|
{
|
|
echo "Usage: dobackupinit [ -h | -help | --help | <MACHINE> ]"
|
|
}
|
|
|
|
#
|
|
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
|
|
REPO_NAME="$1"
|
|
BORG_REPOS="/var/backups/borg"
|
|
|
|
borg init --encryption=repokey-blake2 ${BORG_REPOS}/${REPO_NAME}.repo
|
|
fi
|