Running Multiple Instances of EPM Automate
You can run multiple instances of EPM Automate against one environment from the same directory. Similarly, you can run multiple instances against different environments from the same or different directories.
https://cloudpln.pbcs.us1.oraclecloud.com and
https://testcloudpln.pbcs.us1.oraclecloud.com. In this scenario,
you have two options:
Run Two Sessions from the Same Directory
You can run two instances of EPM Automate
from the same directory. Specific scripts need to be implemented to ensure that each
instance works independently so that logging out of one instance does not log you
out of the other. These scripts ensure that EPM Automate activities continue to run
to completion in the environment even if you sign out from the other instance. This
section contains Windows and Unix/Linux sample scripts (caller and
multisession) that may be used to create two sessions from the
same directory.
To run multiple simultaneous sessions, you add connection information in the
caller script, which calls the multisession
script to run login, uploadfile,
listfiles, and logout commands. You can modify
the multisession script to perform tasks other than these. Make
sure to store these scripts in the same directory.
-
EPM Automate uses the environment variable
EPM_SIDto distinguish multiple sessions. This variable must be set in the caller script to a unique value for each session. In the sample scripts, it is set to unique values as follows:-
In
caller.bat,EPM_SIDis set to!RANDOM!, which assigns it a unique system generated number. This number is also used to generate the log files for each session. If you want to track the log file for each session, you may specify a unique number instead of!RANDOM!. -
In
caller.sh,EPM_SIDis set to the process ID, which is unique. If you want to track the log file for each session, you may specify a uniqueEPM_SIDby modifying theexport EPM_SID=$$statement in themultisessionscript to use the passed in value, and then pass a unique value for this parameter in thecallerscript for each session, for example by specifying the value ofEPM SIDincaller.shas follows:$SCRIPT_DIR/multisession.sh EPM_SID "USERNAME" "PASSWORD" "URL" "/home/user/Snapshot1.zip" & $SCRIPT_DIR/multisession.sh EPM_SID "USERNAME" "PASSWORD" "URL" "/home/user/Snapshot2.zip" &
-
-
USERNAME: Login ID of a Service Administrator -
PASSWORD: Password of the Service Administrator -
URL: Connection URL of the environment
Sample Windows Scripts
caller.bat
@echo off
setlocal EnableExtensions EnableDelayedExpansion
REM syntax: start /B multisession.bat EPM_SID "USERNAME" "PASSWORD" "URL" "SNAPSHOTPATH"
start /B multisession.bat !RANDOM! "USERNAME" "PASSWORD" "URL" "C:\Snapshot1.zip"
start /B multisession.bat !RANDOM! "USERNAME" "PASSWORD" "URL" "C:\Snapshot2.zip"
endlocal
multisession.bat
@echo off
set EPM_SID=%1
set USERNAME=%2
set PASSWORD=%3
set URL=%4
set SNAPSHOTNAME=%5
echo User: %USERNAME% > %EPM_SID%.log
echo Cloud Instance: %URL% >> %EPM_SID%.log
call epmautomate login %USERNAME% %PASSWORD% %URL% >> %EPM_SID%.log
call epmautomate uploadfile %SNAPSHOTNAME% >> %EPM_SID%.log
call epmautomate listfiles >> %EPM_SID%.log
call epmautomate logout
Sample Bourne Shell Script
caller.sh#!/bin/sh
set +x
SCRIPT_DIR=`dirname "${0}"`
# syntax: /home/user/multisession.sh "USERNAME" "PASSWORD" "URL" "SNAPSHOTPATH" &
$SCRIPT_DIR/multisession.sh "USERNAME" "PASSWORD" "URL" "/home/user/Snapshot1.zip" &
$SCRIPT_DIR/multisession.sh "USERNAME" "PASSWORD" "URL" "/home/user/Snapshot2.zip" &
multisession.sh#!/bin/sh
set +x
EPM_AUTOMATE_HOME=/home/user/epmautomate
export JAVA_HOME=/home/user/jre
export EPM_SID=$$
USERNAME=$1
PASSWORD=$2
URL=$3
SNAPSHOTNAME=$4
echo User: $USERNAME > $EPM_SID.log
echo Cloud Instance: $URL >> $EPM_SID.log
$EPM_AUTOMATE_HOME/bin/epmautomate.sh login $USERNAME $PASSWORD $URL >> $EPM_SID.log
$EPM_AUTOMATE_HOME/bin/epmautomate.sh uploadfile $SNAPSHOTNAME >> $EPM_SID.log
$EPM_AUTOMATE_HOME/bin/epmautomate.sh listfiles >> $EPM_SID.log
$EPM_AUTOMATE_HOME/bin/epmautomate.sh logout
Run Two Sessions from Different Directories
On UNIX/Linux servers, you can run two sessions to different environments from different directories without writing specific scripts. The EPM Automatecommands run from two different directories do not interfere with each other and can work independently of each other. This approach does not work on Windows computers where you must use specific scripts mentioned in the previous section,