Relocate BES Client Directory
Log In or Register to download the BES file, and more.

0 Votes

Description

Fixlet used to relocate the BES client directory to a new location. This is typical another file system which has more available disk space. A symbolic link is used.

The new target directory must already exist and have adaquete free space.


Property Details

ID3637
StatusBeta - Preliminary testing ready for more
TitleRelocate BES Client Directory
DomainBESC
CategoryBES Support
SourceInternal
Source Release Date10/23/2013 12:00:00 AM
Added by on 10/24/2013 6:35:14 AM
Last Modified by on 10/24/2013 6:35:14 AM
Counters 4164 Views / 41 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.

Relevance

Used in 6 fixlets   * Results in a true/false
Show indented relevance
name of operating system as lowercase contains "linux"
Used in 1 fixlet   * Results in a true/false
Show indented relevance
not exists symlink "/var/opt/BESClient"

Actions

Action 1 (default)

Action Link Click here to deploy this action.
Script Type BigFix Action Script
delete __createfile

createfile until _EOF_
#!/bin/sh
LOG=/var/tmp/besrelocate.log
RCCMD=/etc/init.d/besclient
TDIR=/home

echo "`date` Attempting to relocate BESClient dir to $TDIR" >> $LOG
if [ ! -d $IDIR ]; then
echo "`date` Target directory $TDIR does not exists!" >> $LOG
exit 1
fi

echo "`date` Stopping BES Client" >> $LOG
$RCCMD stop
sleep 10

cd /var/opt
echo "`date` Backing up BESClient directory" >> $LOG
tar cf /tmp/BESClient.tar BESClient >> $LOG 2>&1
if [ $? -ne 0 ]; then
echo "`date` Error backing up BESClient directory" >> $LOG
exit 1
fi

/bin/rm -rf BESClient

cd $TDIR
echo "`date` Extracting BESClient directory to $TDIR" >> $LOG
tar xf /tmp/BESClient.tar >> $LOG 2>&1
if [ $? -ne 0 ]; then
echo "`date` Error extracting BESClient tar file!" >> $LOG
/bin/rm -f /tmp/BESClient.tar
echo "`date` Restarting bes agent" >> $LOG
$RCCMD start
exit 1
fi

echo "`date` Creating symbolic link" >> $LOG
ln -s $TDIR/BESClient /var/opt/BESClient
if [ $? -ne 0 ]; then
echo "`date` Error creating symbolic link!" >> $LOG
echo "`date` Restoring BESClient directory!" >> $LOG
cd /var/opt
rm -f BESClient
tar xf /tmp/BESClient.tar
/bin/rm -f /tmp/BESClient.tar
echo "`date` Restarting bes agent" >> $LOG
$RCCMD start
exit 1
else
echo "`date` Restarting BES Client" >> $LOG
$RCCMD start
fi
echo "`date` BES Client directory successfully relocated to $TDIR" >> $LOG
exit 0
_EOF_

delete besreloc.sh
move __createfile besreloc.sh
wait sh besreloc.sh
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!