#This script will automatically make an encrypted backup to a restic repository as specified with --source
#
helpFunction()
{
echo""
echo"Usage: $0 -i INPUT -c CONFIG_DIR -l LOG_DIR"
echo -e "\t-i Input folder that should be backed up."
echo -e "\t-c Location of config directory containing repository, password and uuid files."
echo -e "\t-l Location of where the log should be outputted to."
echo -e "Example:"
echo -e "If you pass -i ~/MyServices/SeRvIce1, then the directory you pass as -c must contain files service1_repository, service1_password and service1_uuid (note lower case)"
exit1# Exit script after printing help
}
whilegetopts"i:c:l:" opt
do
case"$opt" in
i )INPUT="$OPTARG";;
c )CONFIG_DIR="$OPTARG";;
l )LOG_DIR="$OPTARG";;
? ) helpFunction ;;# Print helpFunction in case parameter is non-existent