You are here: User Guide > Using LifeKeeper Linux > Advanced Tasks > Sections Common to Remove and Restore

Sections Common to Remove and Restore

1 #!/usr/bin/ksh

2 #ident "@(#)remove 1.1.1.2"

3 # Copyright 2000 SIOS Technology Corp., Mountain View, CA

4 #

5 # usage: remove -t tagname -i fsname (full path)

6 #

8 DEFAULT_FILE=/etc/default/LifeKeeper

9 if [ -z "$LKROOT" ]

10 then

11  PATH=

12  . $DEFAULT_FILE

13  LKROOT=${LKROOT:=/opt/LifeKeeper}

14  PATH=${PATH:=$LKROOT/bin:/usr/bin:/usr/sbin:/bin:/sbin}

15  export LKROOT PATH

16 fi

17 

18 TAG=

19 FSNAME=

20 RCVARG=

21 

22 while [ $# != 0 ]

23 do

24  case "$1" in

25  -t*)

26  if TAG=`$LKROOT/subsys/actions/testflag -t "$1""$2"`

27  then

28   shift

29  fi

30  ;;

31  -i*)

32  if FSNAME=`$LKROOT/subsys/actions/testflag -i "$1""$2"`

33  then

34   shift

35  fi

36  ;;

37  -R)

38  RCVARG=-R

39  ;;

40  esac

41  shift

42 done

43 

44 if [ "$TAG" = "" ]

45 then

46  echo "$0: -t flag not specified"

47  exit 1

48 fi

49 

50 if [ "$FSNAME" = "" ]

51 then

52  echo "$0: -i flag not specified"

53  exit 1

54 fi

55 

56 . $LKROOT/subsys/actions/prfuncs

57 

58 log "LifeKeeper: REMOVE FILE SYSTEM $FSNAME STARTAT:\n\t`date`"

59 

60 err=1

61 

62 trapfunc() {

63  rm -f /tmp/??$$

64  log "LifeKeeper: REMOVE FILE SYSTEM $FSNAME END err=$errAT:\n\t`date`"

65  exit $err

66 }

67 

68 trap "trapfunc" 0 1 2 3 4 6 7 8 10 12 13 15 19

© 2012 SIOS Technology Corp., the industry's leading provider of business continuity solutions, data replication for continuous data protection.