bash-stuff/backup-image/move.sh

26 lines
693 B
Bash
Raw Permalink Normal View History

2024-08-30 11:15:29 +01:00
#!/bin/bash
echo "Move Backup!";
if [ $# -eq 0 ]; then
echo "Usage: move.sh <Backup disk name> <Backup disk new name> [Storage disk root path]";
exit 2;
fi
ssrc="";
if [ -z $3 ]; then
ssrc="/mnt";
else
ssrc="$3";
fi
echo "Source Backup disk name: $1";
echo "Target Backup disk name: $2";
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 "Moving...";
mv -f "$ssrc/hsums/$1-gz.hash" "$ssrc/hsums/$2-gz.hash";
mv -f "$ssrc/hsums/$1-tbl.hash" "$ssrc/hsums/$2-tbl.hash";
mv -f "$ssrc/hsums/$1.hash" "$ssrc/hsums/$2.hash";
mv -f "$ssrc/parts/$1.part.gz" "$ssrc/parts/$2.part.gz";
mv -f "$ssrc/tabls/$1.tbl" "$ssrc/tabls/$2.tbl";
echo "Finished!";
exit 0;