#!/bin/bash

usage()
{
  echo
  echo "Usage: $PROG_NAME"
  echo
  echo " -n      =   Name of the  to start."
  echo
  exit 0
}

set_variable()
{
  local varname=$1
  shift
  if [ -z "${!varname}" ]; then
    eval "$varname=\"$@\""
  else
    echo "Error: $varname already set"
    usage
  fi
}

####################################################################
# Main script starts here

# set_variable PROG_NAME "$(basename "$0")"

# if [[ $1 == "" ]]; then
#     usage;
#     exit;
# else
#     while getopts '?h' c
#     do
#     case $c in
#         h|?) usage ;; esac
#     done
# fi

# ---------------
# Error Handling
# ---------------
# set -e
# trap 'catch $? $LINENO' EXIT

# catch() {
  # echo "catching!"
  # if [ "$1" != "0" ]; then
    # # error handling goes here
    # echo "$PROG_NAME: Error $1 occurred on $2"
  # fi
# }


rclone copy /mnt/disks/lonely_1/borgmatic_local bdrive:/backup/ket/borgmatic_local -vv \
--drive-stop-on-upload-limit \
--syslog \
--bwlimit 4M \
--fast-list \
--tpslimit 8 \
--tpslimit-burst 5 \
--drive-chunk-size 256M
