#!/bin/ash


# usage: borgmatic prune [--stats] [--files] [-h]
# Prune archives according to the retention policy
# prune arguments:
#   --stats     Display statistics of archive
#   --files     Show per-file details
#   -h, --help  Show this help message and exit


usage()
{
  echo
  echo "Usage: $PROG_NAME"
  echo
 
}

borgmatic_prune() {
  echo "$PROG_NAME: Starting repository pruning ..."
  borgmatic prune --stats
  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")"

#!/bin/ash

# usage: borg [common options] break-lock [options] [REPOSITORY]

# Check archives for consistency

# check arguments:
#   --progress    Display progress for each file as it is checked
#   --repair      Attempt to repair any inconsistencies found (experimental and
#                 only for interactive use)
#   --only CHECK  Run a particular consistency check (repository, archives,
#                 data, or extract) instead of configured checks; can specify
#                 flag multiple times
#   -h, --help    Show this help message and exit


borgmatic_prune
