more little fixes

This commit is contained in:
2025-10-28 12:21:11 -04:00
parent 6c1f8c926e
commit 09fd3b2c67
5 changed files with 76 additions and 14 deletions

View File

@@ -33,6 +33,9 @@ MOUNTPOINT_PREFIX="/rubrik_"
HOSTLOGRET=2 HOSTLOGRET=2
MV_SPACE_WARN=75 MV_SPACE_WARN=75
# Number of RMAN channels to allocate per NFS mount
RMAN_CHANNELS_PER_MOUNT=1
# Logging directories # Logging directories
API_LOG_DIR=/tmp/rubrik API_LOG_DIR=/tmp/rubrik
RMAN_LOG_DIR=/tmp/rubrik/rman RMAN_LOG_DIR=/tmp/rubrik/rman
@@ -95,6 +98,7 @@ Performs RMAN database backup with incremental merge to Rubrik Managed Volume.
**Features:** **Features:**
- Incremental level 1 backup with merge - Incremental level 1 backup with merge
- Automatic MV open/close - Automatic MV open/close
- Configurable RMAN channels per NFS mount (RMAN_CHANNELS_PER_MOUNT)
- Disk space monitoring - Disk space monitoring
- Email alerts on failure/success - Email alerts on failure/success
- Archive log backup - Archive log backup
@@ -109,6 +113,7 @@ Performs RMAN archive log backup to Rubrik Managed Volume.
**Features:** **Features:**
- Backs up all not-backed-up archive logs - Backs up all not-backed-up archive logs
- Configurable RMAN channels per NFS mount (RMAN_CHANNELS_PER_MOUNT)
- Automatic MV open/close - Automatic MV open/close
- Disk space monitoring - Disk space monitoring
- Optional host-side log purging - Optional host-side log purging

View File

@@ -37,7 +37,6 @@ case "$os_name" in
DATE=$(command -v gdate) DATE=$(command -v gdate)
else else
DATE=$(command -v date) DATE=$(command -v date)
echo "WARNING: GNU date (gdate) not found. Date arithmetic may not work on HP/UX." >&2
fi fi
;; ;;
*) *)

View File

@@ -68,7 +68,12 @@ fi
echo Running RMAN with log to $RMAN_LOG echo Running RMAN with log to $RMAN_LOG
if [ $numChannels -eq 1 ]; then # Default RMAN channels per mount if not set
RMAN_CHANNELS_PER_MOUNT=${RMAN_CHANNELS_PER_MOUNT:-1}
total_channels=$(expr $numChannels \* $RMAN_CHANNELS_PER_MOUNT)
if [ $total_channels -eq 1 ]; then
allocate="allocate channel 'ch1' device type disk format '$MOUNTPOINT/%U';" allocate="allocate channel 'ch1' device type disk format '$MOUNTPOINT/%U';"
release="release channel ch1;" release="release channel ch1;"
channel0="$MOUNTPOINT" channel0="$MOUNTPOINT"
@@ -77,15 +82,21 @@ else
release="" release=""
i=0 i=0
while [ $i -lt $numChannels ]; do while [ $i -lt $numChannels ]; do
allocate="$allocate allocate channel 'c$i' device type disk format '$MOUNTPOINT/c$i/%U';" j=0
release="$release release channel c$i;" while [ $j -lt $RMAN_CHANNELS_PER_MOUNT ]; do
suffix=$(echo $j | tr '0123456789' 'abcdefghijklmnopqrstuvwxyz')
allocate="$allocate allocate channel 'c${i}${suffix}' device type disk format '$MOUNTPOINT/c$i/%U';"
release="$release release channel c${i}${suffix};"
j=$(expr $j + 1)
done
i=$(expr $i + 1) i=$(expr $i + 1)
done done
channel0="$MOUNTPOINT/c0" channel0="$MOUNTPOINT/c0"
fi fi
# Save the current time (minus one hour) to ensure we catch all archive logs # Save the current time (minus one hour) to ensure we catch all archive logs
startTime=$(date +%m-%d-%Y\ %H:%M:%S -d '-1 hour') startTime=$(perl -e 'use POSIX qw(strftime); $time = time() - 3600; print strftime("%m-%d-%Y %H:%M:%S", localtime($time))')
# RMAN Part Here # RMAN Part Here
############################################################################### ###############################################################################

View File

@@ -62,15 +62,31 @@ fi
echo Running RMAN with log to $RMAN_LOG echo Running RMAN with log to $RMAN_LOG
# Default RMAN channels per mount if not set
RMAN_CHANNELS_PER_MOUNT=${RMAN_CHANNELS_PER_MOUNT:-1}
total_channels=$(expr $numChannels \* $RMAN_CHANNELS_PER_MOUNT)
if [ $total_channels -eq 1 ]; then
allocate="allocate channel 'ch1' device type disk format '$MOUNTPOINT/%U';"
release="release channel ch1;"
channel0="$MOUNTPOINT"
else
allocate="" allocate=""
release="" release=""
i=0 i=0
while [ $i -lt $numChannels ]; do while [ $i -lt $numChannels ]; do
allocate="$allocate allocate channel 'c$i' device type disk format '$MOUNTPOINT/c$i/%U';" j=0
release="$release release channel c$i;" while [ $j -lt $RMAN_CHANNELS_PER_MOUNT ]; do
suffix=$(echo $j | tr '0123456789' 'abcdefghijklmnopqrstuvwxyz')
allocate="$allocate allocate channel 'c${i}${suffix}' device type disk format '$MOUNTPOINT/c$i/%U';"
release="$release release channel c${i}${suffix};"
j=$(expr $j + 1)
done
i=$(expr $i + 1) i=$(expr $i + 1)
done done
channel0="$MOUNTPOINT/c0" channel0="$MOUNTPOINT/c0"
fi
# RMAN Part Here # RMAN Part Here

31
rubrik.conf.example Executable file
View File

@@ -0,0 +1,31 @@
# ID and Key for RSC Service Account (starts with client|) (use single quotes)
ID='client|xxxxxxxxxxxxxxxxxxx'
SECRET=xxxxxxxxxxxxxxxxxxxxxxxx
# DNS name of Rubrik CDM
RUBRIK_IP=<CDM address>
# Oracle Settings
MOUNTPOINT_PREFIX=/rubrik_
# How many hours of archivelog to keep on host. 0 means do not purge logs
HOSTLOGRET=2
# Percentage threshold to warn if an MV filesystem is getting full
MV_SPACE_WARN=75
# Number of RMAN channels to allocate per MV channel
# NOTE: This is not a TOTAL. Total number of RMAN channels will be
# this multipled by the number of channels of the Managed Volume
RMAN_CHANNELS_PER_MOUNT=1
# Logging directories
# API calls
API_LOG_DIR=/tmp/rubrik
# RMAN sessions
RMAN_LOG_DIR=/tmp/rubrik/rman
# List of email addresses to send failure alerts to
ALERT_EMAILS=root,oracle
# Set to 1 to enable email alert on success also
EMAIL_SUCCESS=1