hpux updates
This commit is contained in:
25
list_mv.sh
25
list_mv.sh
@@ -1,13 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# List MVs using API call to CDM, for diagnostic purposes
|
# List MVs using API call to RSC, for diagnostic purposes
|
||||||
# Written for HCL / Nokia
|
# Written for HCL / Nokia
|
||||||
# v1.1 - James Pattinson - October 2025
|
# v1.1 - James Pattinson - October 2025
|
||||||
#
|
#
|
||||||
# usage: list_mv.sh
|
# usage: list_mv.sh
|
||||||
|
|
||||||
|
|
||||||
MYDIR="$(dirname "$(readlink -f "$0")")"
|
get_script_dir() {
|
||||||
|
# Portable way to get script directory for Linux and HP/UX
|
||||||
|
local src="$0"
|
||||||
|
while [ -h "$src" ]; do
|
||||||
|
dir="$(cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd)"
|
||||||
|
src="$(readlink "$src")"
|
||||||
|
[[ $src != /* ]] && src="$dir/$src"
|
||||||
|
done
|
||||||
|
cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd
|
||||||
|
}
|
||||||
|
MYDIR="$(get_script_dir)"
|
||||||
source $MYDIR/rbk_api.conf
|
source $MYDIR/rbk_api.conf
|
||||||
source $MYDIR/oracle_funcs.sh
|
source $MYDIR/oracle_funcs.sh
|
||||||
|
|
||||||
@@ -15,18 +25,11 @@ source $MYDIR/oracle_funcs.sh
|
|||||||
|
|
||||||
echo Service account in use is $ID
|
echo Service account in use is $ID
|
||||||
|
|
||||||
echo ALL MVs
|
echo "Managed Volumes"
|
||||||
|
|
||||||
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume"
|
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume"
|
||||||
rest_api_get
|
rest_api_get
|
||||||
|
|
||||||
grep -Eo '"name"[^,]*' /tmp/rbkresponse.$$
|
grep -o '"name":"[^"]*"' /tmp/rbkresponse.$$ | cut -d'"' -f4
|
||||||
|
|
||||||
echo NonRelic MVs
|
|
||||||
|
|
||||||
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?is_relic=false"
|
|
||||||
rest_api_get
|
|
||||||
|
|
||||||
grep -Eo '"name"[^,]*' /tmp/rbkresponse.$$
|
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
|||||||
107
oracle_funcs.sh
107
oracle_funcs.sh
@@ -10,15 +10,41 @@ LOGFILE=$API_LOG_DIR/api_calls.log
|
|||||||
mkdir -p $API_LOG_DIR
|
mkdir -p $API_LOG_DIR
|
||||||
tabwidth=25
|
tabwidth=25
|
||||||
|
|
||||||
HOST=$(hostname -s)
|
|
||||||
|
|
||||||
os=$(uname -o)
|
# Portable short hostname function
|
||||||
if [ $os == "Solaris" ]; then
|
get_short_hostname() {
|
||||||
# Use the GNU version of date binary
|
if hostname -s >/dev/null 2>&1; then
|
||||||
DATE=/usr/gnu/bin/date
|
hostname -s
|
||||||
else
|
else
|
||||||
|
hostname | awk -F. '{print $1}'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
HOST=$(get_short_hostname)
|
||||||
|
|
||||||
|
|
||||||
|
# Detect OS and set DATE variable appropriately
|
||||||
|
os_name=$(uname -s)
|
||||||
|
case "$os_name" in
|
||||||
|
Linux)
|
||||||
DATE=$(which date)
|
DATE=$(which date)
|
||||||
fi
|
;;
|
||||||
|
SunOS)
|
||||||
|
# Solaris
|
||||||
|
DATE=/usr/gnu/bin/date
|
||||||
|
;;
|
||||||
|
HP-UX)
|
||||||
|
# HP/UX: try gdate, fallback to date with warning
|
||||||
|
if command -v gdate >/dev/null 2>&1; then
|
||||||
|
DATE=$(command -v gdate)
|
||||||
|
else
|
||||||
|
DATE=$(command -v date)
|
||||||
|
echo "WARNING: GNU date (gdate) not found. Date arithmetic may not work on HP/UX." >&2
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
DATE=$(which date)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
echo "`$DATE` -$$-: CALLED $0 $@" >> $LOGFILE
|
echo "`$DATE` -$$-: CALLED $0 $@" >> $LOGFILE
|
||||||
|
|
||||||
@@ -35,13 +61,13 @@ function ctrl_c_inhibit () {
|
|||||||
|
|
||||||
exit_with_error () {
|
exit_with_error () {
|
||||||
# if [ $usingsatoken ]; then
|
# if [ $usingsatoken ]; then
|
||||||
# ENDPOINT="https://$RUBRIK_IP/api/v1/session/me"
|
# ENDPOINT="https://$RUBRIK_IP/api/internal/session/me"
|
||||||
# rest_api_delete
|
# rest_api_delete
|
||||||
# check_http_error
|
# check_http_error
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
cat /tmp/rbkresponse.$$ | mailx -s "Backup error on ${HOST} for ${ORACLE_SID}. Please investigate" $ALERT_EMAILS
|
cat /tmp/rbkresponse.$$ | mailx -s "Backup error on ${HOST} for ${ORACLE_SID}. Please investigate" $ALERT_EMAILS
|
||||||
rm -f /tmp/rbkresponse.$$
|
#rm -f /tmp/rbkresponse.$$
|
||||||
rm -f /tmp/mountedDBs.$$
|
rm -f /tmp/mountedDBs.$$
|
||||||
rm -f $PIDFILE
|
rm -f $PIDFILE
|
||||||
echo Aborting Script!
|
echo Aborting Script!
|
||||||
@@ -62,11 +88,13 @@ check_pid () {
|
|||||||
if [ -f $PIDFILE ]
|
if [ -f $PIDFILE ]
|
||||||
then
|
then
|
||||||
PID=$(cat $PIDFILE)
|
PID=$(cat $PIDFILE)
|
||||||
ps -p $PID > /dev/null 2>&1
|
if ps -p $PID > /dev/null 2>&1; then
|
||||||
if [ $? -eq 0 ]
|
|
||||||
then
|
|
||||||
echo "ERROR: MV already being used by process ID $PID"
|
echo "ERROR: MV already being used by process ID $PID"
|
||||||
|
if ps -fp $PID > /dev/null 2>&1; then
|
||||||
ps -fp $PID
|
ps -fp $PID
|
||||||
|
else
|
||||||
|
ps -ef | awk -v pid=$PID '$2==pid'
|
||||||
|
fi
|
||||||
exit_with_error
|
exit_with_error
|
||||||
else
|
else
|
||||||
## Process not found assume not running
|
## Process not found assume not running
|
||||||
@@ -88,27 +116,11 @@ check_pid () {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Get a new token only if AUTH_TOKEN is not already set
|
||||||
check_get_token () {
|
check_get_token () {
|
||||||
|
if [ -z "$AUTH_TOKEN" ]; then
|
||||||
if [ -z "${AUTH_TOKEN}" ]; then
|
|
||||||
|
|
||||||
# RSC
|
|
||||||
id_string=$(echo $ID | cut -d\| -f 2)
|
|
||||||
# CDM
|
|
||||||
id_string=$(echo $ID | cut -d: -f 4)
|
|
||||||
|
|
||||||
if [ -f ~/.rbksession.$id_string ]; then
|
|
||||||
echo "`$DATE` -$$-: AUTH SESSION FILE EXISTS" >> $LOGFILE
|
|
||||||
read expiration token < <(echo $(cat ~/.rbksession.$id_string))
|
|
||||||
if [ $($DATE +%s -u -d $expiration) -lt $(( $($DATE +%s) + 1800 )) ]; then
|
|
||||||
echo "`$DATE` -$$-: AUTH TOKEN EXPIRED" >> $LOGFILE
|
|
||||||
get_token
|
get_token
|
||||||
else
|
|
||||||
AUTH_TOKEN=$token
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
get_token
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,14 +134,11 @@ get_token () {
|
|||||||
http_response=$(curl -s -k -o /tmp/rbkresponse.$$ -w "%{http_code}" -X POST $MYENDPOINT -H "accept: application/json" -H "Content-Type: application/json" -d $MYPAYLOAD)
|
http_response=$(curl -s -k -o /tmp/rbkresponse.$$ -w "%{http_code}" -X POST $MYENDPOINT -H "accept: application/json" -H "Content-Type: application/json" -d $MYPAYLOAD)
|
||||||
check_http_error
|
check_http_error
|
||||||
|
|
||||||
AUTH_TOKEN=$(grep -Eo '"token"[^,]*' /tmp/rbkresponse.$$ | grep -Eo '[^:]*$' | sed 's/\"//g')
|
AUTH_TOKEN=$(grep -o '"token":"[^"]*"' /tmp/rbkresponse.$$ | cut -d'"' -f4)
|
||||||
SESSION=$(grep -Eo '"sessionId"[^,]*' /tmp/rbkresponse.$$ | grep -Eo '[^:]*$' | sed 's/\"//g')
|
SESSION=$(egrep '"sessionId"[^,]*' /tmp/rbkresponse.$$ | awk -F: '{print $2}' | sed 's/\"//g')
|
||||||
EXPIRATION=$(grep -Eo '"expirationTime"[^,]*' /tmp/rbkresponse.$$ | cut -d: -f 2-4 | sed 's/\"//g' | sed 's/.000Z//;s/T/Z/')
|
EXPIRATION=$(egrep '"expirationTime"[^,]*' /tmp/rbkresponse.$$ | awk -F: '{print $2}' | sed 's/\"//g' | sed 's/.000Z//;s/T/Z/')
|
||||||
|
|
||||||
echo "`$DATE` -$$-: AUTH SESSION $SESSION" >> $LOGFILE
|
echo "`$DATE` -$$-: AUTH SESSION $SESSION" >> $LOGFILE
|
||||||
echo "`$DATE` -$$-: SAVING TOKEN TO FILE" >> $LOGFILE
|
|
||||||
echo "$EXPIRATION $AUTH_TOKEN" > ~/.rbksession.$id_string
|
|
||||||
usingsatoken=1
|
|
||||||
trap ctrl_c INT
|
trap ctrl_c INT
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,8 +214,8 @@ get_mv () {
|
|||||||
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
||||||
rest_api_get
|
rest_api_get
|
||||||
|
|
||||||
mvId=$(grep -Eo '"id"[^,]*' /tmp/rbkresponse.$$ | grep -Eo 'ManagedVolume:::[a-z0-9-]*')
|
mvId=$(egrep '"id"[^,]*' /tmp/rbkresponse.$$ | egrep -o 'ManagedVolume:::[a-z0-9-]*')
|
||||||
numChannels=$(grep -Eo '"numChannels"[^,]*' /tmp/rbkresponse.$$ | cut -d: -f2)
|
numChannels=$(egrep '"numChannels"[^,]*' /tmp/rbkresponse.$$ | awk -F: '{print $2}')
|
||||||
|
|
||||||
if [[ $mvId == "" ]]; then
|
if [[ $mvId == "" ]]; then
|
||||||
echo ERROR: MV with name $mv_name was not found
|
echo ERROR: MV with name $mv_name was not found
|
||||||
@@ -222,8 +231,8 @@ get_data_mv () {
|
|||||||
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
||||||
rest_api_get
|
rest_api_get
|
||||||
|
|
||||||
mvId=$(grep -Eo '"id"[^,]*' /tmp/rbkresponse.$$ | grep -Eo 'ManagedVolume:::[a-z0-9-]*')
|
mvId=$(egrep '"id"[^,]*' /tmp/rbkresponse.$$ | egrep -o 'ManagedVolume:::[a-z0-9-]*')
|
||||||
numChannels=$(grep -Eo '"numChannels"[^,]*' /tmp/rbkresponse.$$ | cut -d: -f2)
|
numChannels=$(egrep '"numChannels"[^,]*' /tmp/rbkresponse.$$ | awk -F: '{print $2}')
|
||||||
|
|
||||||
if [[ $mvId == "" ]]; then
|
if [[ $mvId == "" ]]; then
|
||||||
echo ERROR: MV with name $mv_name was not found
|
echo ERROR: MV with name $mv_name was not found
|
||||||
@@ -240,7 +249,7 @@ get_log_mv () {
|
|||||||
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
||||||
rest_api_get
|
rest_api_get
|
||||||
|
|
||||||
logMvId=$(grep -Eo '"id"[^,]*' /tmp/rbkresponse.$$ | grep -Eo 'ManagedVolume:::[a-z0-9-]*')
|
logMvId=$(egrep '"id"[^,]*' /tmp/rbkresponse.$$ | egrep -o 'ManagedVolume:::[a-z0-9-]*')
|
||||||
|
|
||||||
if [[ $logMvId == "" ]]; then
|
if [[ $logMvId == "" ]]; then
|
||||||
echo "INFO: Log volume ($mv_name) not found. Logs will be written to DB volume"
|
echo "INFO: Log volume ($mv_name) not found. Logs will be written to DB volume"
|
||||||
@@ -250,16 +259,16 @@ get_log_mv () {
|
|||||||
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
||||||
rest_api_get
|
rest_api_get
|
||||||
|
|
||||||
mvId=$(grep -Eo '"id"[^,]*' /tmp/rbkresponse.$$ | grep -Eo 'ManagedVolume:::[a-z0-9-]*')
|
mvId=$(egrep '"id"[^,]*' /tmp/rbkresponse.$$ | egrep -o 'ManagedVolume:::[a-z0-9-]*')
|
||||||
numChannels=$(grep -Eo '"numChannels"[^,]*' /tmp/rbkresponse.$$ | cut -d: -f2)
|
numChannels=$(egrep '"numChannels"[^,]*' /tmp/rbkresponse.$$ | awk -F: '{print $2}')
|
||||||
|
|
||||||
if [[ $mvId == "" ]]; then
|
if [[ $mvId == "" ]]; then
|
||||||
echo ERROR: MV with name $mv_name was not found
|
echo ERROR: MV with name $mv_name was not found
|
||||||
exit_with_error
|
exit_with_error
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
mvId=$(grep -Eo '"id"[^,]*' /tmp/rbkresponse.$$ | grep -Eo 'ManagedVolume:::[a-z0-9-]*')
|
mvId=$(egrep '"id"[^,]*' /tmp/rbkresponse.$$ | egrep -o 'ManagedVolume:::[a-z0-9-]*')
|
||||||
numChannels=$(grep -Eo '"numChannels"[^,]*' /tmp/rbkresponse.$$ | cut -d: -f2)
|
numChannels=$(egrep '"numChannels"[^,]*' /tmp/rbkresponse.$$ | awk -F: '{print $2}')
|
||||||
logMvPresent=1
|
logMvPresent=1
|
||||||
echo "INFO: Log volume ($mv_name) exists with $numChannels channels"
|
echo "INFO: Log volume ($mv_name) exists with $numChannels channels"
|
||||||
fi
|
fi
|
||||||
@@ -294,11 +303,11 @@ close_mv () {
|
|||||||
|
|
||||||
cleanup () {
|
cleanup () {
|
||||||
# if [ $usingsatoken ]; then
|
# if [ $usingsatoken ]; then
|
||||||
# ENDPOINT="https://$RUBRIK_IP/api/v1/session/me"
|
# ENDPOINT="https://$RUBRIK_IP/api/internal/session/me"
|
||||||
# rest_api_delete
|
# rest_api_delete
|
||||||
# fi
|
# fi
|
||||||
echo "`$DATE` -$$-: EXITED $0 $@" >> $LOGFILE
|
echo "`$DATE` -$$-: EXITED $0 $@" >> $LOGFILE
|
||||||
rm -f /tmp/mountedDBs.$$
|
#rm -f /tmp/mountedDBs.$$
|
||||||
rm -f /tmp/rbkresponse.$$
|
#rm -f /tmp/rbkresponse.$$
|
||||||
rm -f $PIDFILE
|
rm -f $PIDFILE
|
||||||
}
|
}
|
||||||
|
|||||||
16
rman_db.sh
16
rman_db.sh
@@ -6,7 +6,17 @@
|
|||||||
#
|
#
|
||||||
# usage: rman_db.sh <ORACLE_SID>
|
# usage: rman_db.sh <ORACLE_SID>
|
||||||
|
|
||||||
MYDIR="$(dirname "$(readlink -f "$0")")"
|
get_script_dir() {
|
||||||
|
# Portable way to get script directory for Linux and HP/UX
|
||||||
|
local src="$0"
|
||||||
|
while [ -h "$src" ]; do
|
||||||
|
dir="$(cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd)"
|
||||||
|
src="$(readlink "$src")"
|
||||||
|
[[ $src != /* ]] && src="$dir/$src"
|
||||||
|
done
|
||||||
|
cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd
|
||||||
|
}
|
||||||
|
MYDIR="$(get_script_dir)"
|
||||||
|
|
||||||
export ORACLE_SID=$1
|
export ORACLE_SID=$1
|
||||||
|
|
||||||
@@ -42,7 +52,7 @@ mkdir -p $RMAN_LOG_DIR/$ORACLE_SID/
|
|||||||
RMAN_LOG=$RMAN_LOG_DIR/$ORACLE_SID/rman_${ORACLE_SID}_DB_$(date +%d%m%y).log
|
RMAN_LOG=$RMAN_LOG_DIR/$ORACLE_SID/rman_${ORACLE_SID}_DB_$(date +%d%m%y).log
|
||||||
|
|
||||||
# Disk space check
|
# Disk space check
|
||||||
dusage=$(df -Ph | grep -E "$MOUNTPOINT" | sed s/%//g | awk -v spaceWarn=$MV_SPACE_WARN '{ if($5 >= spaceWarn) print $0;}')
|
dusage=$(df -Ph | egrep "$MOUNTPOINT" | sed s/%//g | awk -v spaceWarn=$MV_SPACE_WARN '{ if($5 >= spaceWarn) print $0;}')
|
||||||
if [ "$dusage" != "" ]; then
|
if [ "$dusage" != "" ]; then
|
||||||
echo "WARNING: Disk Space Alert - sending email"
|
echo "WARNING: Disk Space Alert - sending email"
|
||||||
echo "$dusage" | mailx -s "WARNING: Rubrik MV Disk Space Alert On $(hostname) at $(date)" $ALERT_EMAILS
|
echo "$dusage" | mailx -s "WARNING: Rubrik MV Disk Space Alert On $(hostname) at $(date)" $ALERT_EMAILS
|
||||||
@@ -116,6 +126,6 @@ elif [ $EMAIL_SUCCESS -eq 1 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Change permission of backup files to enable alternate host restore
|
# Change permission of backup files to enable alternate host restore
|
||||||
find $MOUNTPOINT -type f -exec chmod 644 -- {} + 2>/dev/null
|
find $MOUNTPOINT -type f -exec chmod 644 {} + 2>/dev/null
|
||||||
|
|
||||||
close_mv
|
close_mv
|
||||||
16
rman_logs.sh
16
rman_logs.sh
@@ -6,7 +6,17 @@
|
|||||||
#
|
#
|
||||||
# usage: rman_logs.sh <ORACLE_SID>
|
# usage: rman_logs.sh <ORACLE_SID>
|
||||||
|
|
||||||
MYDIR="$(dirname "$(readlink -f "$0")")"
|
get_script_dir() {
|
||||||
|
# Portable way to get script directory for Linux and HP/UX
|
||||||
|
local src="$0"
|
||||||
|
while [ -h "$src" ]; do
|
||||||
|
dir="$(cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd)"
|
||||||
|
src="$(readlink "$src")"
|
||||||
|
[[ $src != /* ]] && src="$dir/$src"
|
||||||
|
done
|
||||||
|
cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd
|
||||||
|
}
|
||||||
|
MYDIR="$(get_script_dir)"
|
||||||
export ORACLE_SID=$1
|
export ORACLE_SID=$1
|
||||||
|
|
||||||
. $HOME/.profile
|
. $HOME/.profile
|
||||||
@@ -53,7 +63,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Disk space check
|
# Disk space check
|
||||||
dusage=$(df -Ph | grep -E "$MOUNTPOINT" | sed s/%//g | awk -v spaceWarn=$MV_SPACE_WARN '{ if($5 >= spaceWarn) print $0;}')
|
dusage=$(df -Ph | egrep "$MOUNTPOINT" | sed s/%//g | awk -v spaceWarn=$MV_SPACE_WARN '{ if($5 >= spaceWarn) print $0;}')
|
||||||
if [ "$dusage" != "" ]; then
|
if [ "$dusage" != "" ]; then
|
||||||
echo "WARNING: Disk Space Alert - sending email"
|
echo "WARNING: Disk Space Alert - sending email"
|
||||||
echo "$dusage" | mailx -s "WARNING: Rubrik MV Disk Space Alert On $(hostname) at $(date)" $ALERT_EMAILS
|
echo "$dusage" | mailx -s "WARNING: Rubrik MV Disk Space Alert On $(hostname) at $(date)" $ALERT_EMAILS
|
||||||
@@ -107,7 +117,7 @@ elif [ $EMAIL_SUCCESS -eq 1 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Change permission of backup files to enable alternate host restore
|
# Change permission of backup files to enable alternate host restore
|
||||||
find $MOUNTPOINT -type f -exec chmod 644 -- {} + 2>/dev/null
|
find $MOUNTPOINT -type f -exec chmod 644 {} + 2>/dev/null
|
||||||
|
|
||||||
close_mv
|
close_mv
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,17 @@
|
|||||||
# -v Volume to operate on, logs or data
|
# -v Volume to operate on, logs or data
|
||||||
# -o Operation to perform - open or close the MV
|
# -o Operation to perform - open or close the MV
|
||||||
|
|
||||||
MYDIR="$(dirname "$(readlink -f "$0")")"
|
get_script_dir() {
|
||||||
|
# Portable way to get script directory for Linux and HP/UX
|
||||||
|
local src="$0"
|
||||||
|
while [ -h "$src" ]; do
|
||||||
|
dir="$(cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd)"
|
||||||
|
src="$(readlink "$src")"
|
||||||
|
[[ $src != /* ]] && src="$dir/$src"
|
||||||
|
done
|
||||||
|
cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd
|
||||||
|
}
|
||||||
|
MYDIR="$(get_script_dir)"
|
||||||
source $MYDIR/rbk_api.conf
|
source $MYDIR/rbk_api.conf
|
||||||
source $MYDIR/oracle_funcs.sh
|
source $MYDIR/oracle_funcs.sh
|
||||||
|
|
||||||
@@ -42,7 +52,14 @@ fi
|
|||||||
|
|
||||||
# Script starts here
|
# Script starts here
|
||||||
|
|
||||||
mv_name=$(hostname -s)_${DBNAME}_${VOLUME}
|
get_short_hostname() {
|
||||||
|
if hostname -s >/dev/null 2>&1; then
|
||||||
|
hostname -s
|
||||||
|
else
|
||||||
|
hostname | awk -F. '{print $1}'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
mv_name=$(get_short_hostname)_${DBNAME}_${VOLUME}
|
||||||
get_mv
|
get_mv
|
||||||
|
|
||||||
case $OPCODE in
|
case $OPCODE in
|
||||||
|
|||||||
Reference in New Issue
Block a user