Relocate BES Client Directory
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
3637 | |
Beta - Preliminary testing ready for more | |
Relocate BES Client Directory | |
BESC | |
BES Support | |
Internal | |
10/23/2013 12:00:00 AM | |
DavidSmith on 10/24/2013 6:35:14 AM | |
DavidSmith on 10/24/2013 6:35:14 AM | |
4164 Views / 41 Downloads | |
* Average over 0 ratings. ** Log In or Register to add your rating. |
Relevance
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: |