2009-06-05 13:53:52 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# IBM(c) 2009 EPL license http://www.eclipse.org/legal/epl-v10.html
|
2009-06-04 15:33:44 +00:00
|
|
|
#####################################################
|
|
|
|
#
|
2009-06-05 13:53:52 +00:00
|
|
|
# Initiate the xdcp from Mangement node to sync
|
|
|
|
# files to this node
|
2009-06-04 15:33:44 +00:00
|
|
|
#
|
|
|
|
#####################################################
|
|
|
|
|
2009-07-29 21:25:59 +00:00
|
|
|
# do nothing when UPDATENODE=1 because it is done from the top down
|
2011-08-19 21:29:56 +00:00
|
|
|
if [ -n "$UPDATENODE" ] && [ $UPDATENODE -eq 1 ]; then
|
2013-01-24 13:06:06 +00:00
|
|
|
#echo " Did not sync any files. Use updatenode -F to sync the files."
|
|
|
|
logger -t xCAT -p local4.err "$0: Did not sync any files. Use updatenode -F to sync the files."
|
2011-04-14 13:02:45 +00:00
|
|
|
|
2009-07-29 21:25:59 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
#do nothing id there is no sync file template for the node
|
2011-08-19 21:29:56 +00:00
|
|
|
if [ -n "$NOSYNCFILES" ] && [ $NOSYNCFILES -eq 1 ]; then
|
2010-04-08 10:06:55 +00:00
|
|
|
echo " Did not sync any files."
|
2012-05-15 03:05:32 +00:00
|
|
|
logger -t xCAT -p local4.err "$0: there is no sync file template for the node"
|
2009-07-29 21:25:59 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2012-05-15 03:05:32 +00:00
|
|
|
logger -t xCAT -p local4.info "Performing syncfiles postscript"
|
2009-06-04 15:33:44 +00:00
|
|
|
|
2009-06-05 13:53:52 +00:00
|
|
|
osname=`uname`
|
2009-06-04 15:33:44 +00:00
|
|
|
# run the xdcp on the MN/SN
|
2009-06-05 13:53:52 +00:00
|
|
|
xcatpostdir="/xcatpost"
|
2009-06-04 15:33:44 +00:00
|
|
|
|
2012-05-15 03:05:32 +00:00
|
|
|
logger -t xCAT -p local4.info "$0: the OS name = $osname"
|
2011-12-29 10:36:57 +00:00
|
|
|
quit="no"
|
|
|
|
count=5
|
|
|
|
while [ $quit = "no" ]; do
|
|
|
|
if [ $osname = "Linux" ]
|
|
|
|
then
|
|
|
|
`$xcatpostdir/startsyncfiles.awk`
|
|
|
|
returncode=$?
|
|
|
|
elif [ $osname = "AIX" ]
|
|
|
|
then
|
|
|
|
`$xcatpostdir/startsyncfiles.aix`
|
|
|
|
returncode=$?
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $returncode -eq 0 ] || [ $count -eq 0 ]; then
|
|
|
|
quit="yes"
|
|
|
|
else
|
|
|
|
let SLI=$RANDOM%10
|
|
|
|
let SLI=SLI+10
|
|
|
|
sleep $SLI
|
|
|
|
fi
|
|
|
|
let count=count-1
|
|
|
|
done
|
2009-07-15 13:08:51 +00:00
|
|
|
|
2011-02-28 07:33:57 +00:00
|
|
|
if [ $returncode -eq 0 ]
|
2009-07-15 13:08:51 +00:00
|
|
|
then
|
2012-05-15 03:05:32 +00:00
|
|
|
logger -t xCAT -p local4.info "$0: Perform Syncing File action successfully"
|
2009-07-15 13:08:51 +00:00
|
|
|
else
|
2012-05-15 03:05:32 +00:00
|
|
|
logger -t xCAT -p local4.err "$0: Perform Syncing File action encountered error"
|
2009-06-05 13:53:52 +00:00
|
|
|
fi
|
2009-06-04 15:33:44 +00:00
|
|
|
|
2009-06-05 13:53:52 +00:00
|
|
|
exit 0
|
2010-03-31 06:35:27 +00:00
|
|
|
|