Posted by: vineetvijay12
« on: June 11, 2012, 08:58:36 AM »1. Get the current SITE by running following command.
if [[ `uname` == "Linux" ]]
then IP1=$(/sbin/route -n | grep UG | awk '{print $2}' | awk -F\. '{print $1$2}')
else
IP1=$(netstat -rn | grep " 0.0.0.0" | head -1 | awk '{print $3}' | awk -F\. '{print $1$2}')
fi
case $IP1
in
123) SITE=x;;
124) SITE=y ;;
125) SITE=z ;;
*) unset SITE ;;
esac
2. assign some values to variables.
and get a variable SITES=$(echo "x y" | sed s/$SITE//)
3. Get the path of File opened and put into a variable.
s:\x\y_z_w\sq\123.tcle
4. convert dos path to unix path
5. check there should be atleash three strings in path like S:\x\y_z_w
otherwise error and fail.
6. rsync command to other site.
Thanks
Vineet
if [[ `uname` == "Linux" ]]
then IP1=$(/sbin/route -n | grep UG | awk '{print $2}' | awk -F\. '{print $1$2}')
else
IP1=$(netstat -rn | grep " 0.0.0.0" | head -1 | awk '{print $3}' | awk -F\. '{print $1$2}')
fi
case $IP1
in
123) SITE=x;;
124) SITE=y ;;
125) SITE=z ;;
*) unset SITE ;;
esac
2. assign some values to variables.
and get a variable SITES=$(echo "x y" | sed s/$SITE//)
3. Get the path of File opened and put into a variable.
s:\x\y_z_w\sq\123.tcle
4. convert dos path to unix path
5. check there should be atleash three strings in path like S:\x\y_z_w
otherwise error and fail.
6. rsync command to other site.
Thanks
Vineet