bash-stuff/backup-image/remove.sh

25 lines
521 B
Bash
Executable File

#!/bin/bash
echo "Remove Backup!";
if [ $# -eq 0 ]; then
echo "Usage: remove.sh <Backup disk name> [Storage disk root path]";
exit 2;
fi
ssrc="";
if [ -z $2 ]; then
ssrc="/mnt";
else
ssrc="$2";
fi
echo "Source Backup disk name: $1";
echo "Storage disk root path: $ssrc";
echo "Press Enter to Start...";
read;
echo "Deleting...";
rm -f "$ssrc/hsums/$1-gz.hash";
rm -f "$ssrc/hsums/$1-tbl.hash";
rm -f "$ssrc/hsums/$1.hash";
rm -f "$ssrc/parts/$1.part.gz";
rm -f "$ssrc/tabls/$1.tbl";
echo "Finished!";
exit 0;