#!/bin/bash USER_ROOT=/home/fasoonli CONFIG_FILE="$USER_ROOT/backup-config" . $CONFIG_FILE if [ $# -eq 0 ]; then echo -e "Usage: $0 BACKUP_NAME\nPlease use ./$SCRIPT_LIST to view available backups" exit 1 fi BACKUP_NAME="$1" FOUND=$(find_backup_by_name "$BACKUP_NAME") if [[ $FOUND == "" ]]; then echo -e "No backup \"$BACKUP_NAME\" found.\nPlease use ./$SCRIPT_LIST to view available backups" exit 2 fi BACKUP_NAME_Q="$FOUND" BACKUP_PATH="$BACKUP_ROOT/$BACKUP_NAME_Q" #good to go rm -rf "$BACKUP_PATH" echo "Done!"