bash-stuff/backup-image/remove.sh

25 lines
521 B
Bash
Raw Permalink Normal View History

2024-08-30 11:15:29 +01:00
#!/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";
2024-08-30 13:16:28 +01:00
echo "Storage disk root path: $ssrc";
2024-08-30 11:15:29 +01:00
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;