tm_lvm_delete2.sh
1 |
SRC=$1 |
---|---|
2 |
DST=$2 |
3 |
|
4 |
if [ -z "${ONE_LOCATION}" ]; then |
5 |
TMCOMMON=/usr/lib/one/mads/tm_common.sh |
6 |
else |
7 |
TMCOMMON=$ONE_LOCATION/lib/mads/tm_common.sh |
8 |
fi |
9 |
|
10 |
. $TMCOMMON |
11 |
|
12 |
SRC_PATH=`arg_path $SRC` |
13 |
SRC_HOST=`arg_host $SRC` |
14 |
|
15 |
log "SRC: $SRC_PATH" |
16 |
log "SRC_HOST: $SRC_HOST" |
17 |
|
18 |
VOL_NAME=`echo $SRC_PATH | awk -F/ '{print $4"-"0}'` |
19 |
DST_DIR_IMAGES=`echo $SRC_PATH | awk -F/ '{print "/"$2"/"$3"/"$4}'` |
20 |
|
21 |
log "Deleting $DST_DIR_IMAGES..." |
22 |
exec_and_log "ssh $SRC_HOST rm -rf $DST_DIR_IMAGES " |
23 |
|
24 |
log "Removing Logical Volume $VOL_NAME..." |
25 |
exec_and_log "ssh $SRC_HOST sudo /usr/sbin/lvremove |
26 |
-f /dev/xen_vg/$VOL_NAME " |