oracledba.help
Scripts

DBA Script

<- Scripts

#!/bin/bash
# @reboot $SCRIPTS/initMntPts.sh > $OUT/initMntPts.out
# Version: 2019.02
# Notes:   umount -f /u03

# User Vars
nWait=35; # How many seconds to wait before attempting to mount.
sWinSrv="mlbisilonsmb01";
sWinShare="//$sWinSrv/ORACLEBACKUPS";
sMountPt="/mnt/mlbisilonsmb01";
sAuth="username=oraclebackup,domain=sccu,password=ajKwqOprymHw1ycgeQd6,vers=2.0";
###sAuth="username=oraclebackup,password=*****"; # Legacy Method

# Start
clear;printf "$(basename ""$0""): Started $(date "+%Y-%m-%d %H:%M:%S")\n"
printf "Waiting $nWait seconds...\n"
sleep $nWait

# Process
printf "Processing...\n"
ping -q -c 3 $sWinSrv > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
   printf "Cannot Reach $sWinSrv \n"
else
   printf "$sWinSrv: OK\n"
   mount -t cifs $sWinShare -o $sAuth $sMountPt
fi

# End
printf "$(basename ""$0""): Ended $(date "+%Y-%m-%d %H:%M:%S")\n"