Uploading files to My Oracle Support
When interacting with Oracle Support, it’s quite common that the Oracle engineer asks for a log file, an Explorer Data Collector Output or a Support Bundle. Normally, these files are uploaded through the My Oracle Support web portal, but if you have to upload more than file, this can be a time consuming task.
To make this task easier, Oracle does allow to upload files with curl:
curl -T<file>
-u "<user>
" https://transport.oracle.com/upload/issue/<sr_number>
/
Unfortunately, Oracle does not provide any tool or script to upload easily multiple files. To make my life easier, I’ve wrote this script:
#!/usr/bin/env bash MYNAME=`basename $0` USER_NAME=${1} SERVICE_REQUEST=${2} UPLOAD_URL=https://transport.oracle.com/upload/issue FILE_COUNT=`echo ${#}-2 | bc` printhelp() { echo " Usage: ${MYNAME} <User Name> <Service Request> <File Names> ..." echo " Example: ${MYNAME} e-mail@example.com 3-12345678901 example.tar.gz" } # Print help if not enough options if [ $# -lt 3 ] ; then printhelp exit 1 fi # Add PROXY variable if needed if [ ${https_proxy} ]; then PROXY=${https_proxy} fi # Add file names to FILE_NAMES variable FILE_COUNTX=${FILE_COUNT} while [ ${FILE_COUNTX} != 0 ]; do FILE_NAMES+="${3} " shift FILE_COUNTX=`echo ${FILE_COUNTX}-1 | bc` done # Check if all files are existent for FILE_NAME in ${FILE_NAMES} ; do if [ ! -f ${FILE_NAME} ]; then echo .:: ERROR ::. echo "==> \"${FILE_NAME}\" does not exist or is not a regular file!" exit 1 fi done # Get user password read -s -p "Password: " USER_PASSWORD echo # Upload all files echo "==> Uploading ${FILE_COUNT} files." for FILE_NAME in ${FILE_NAMES} ; do CURL_OPTIONS="--upload-file ${FILE_NAME} --user ${USER_NAME}:${USER_PASSWORD} ${UPLOAD_URL}/${SERVICE_REQUEST}/" echo "==> Uploading ${FILE_NAME}" if [ ${PROXY} ]; then curl -x ${PROXY} ${CURL_OPTIONS} else curl ${CURL_OPTIONS} fi done
The Script requires at least Bash version 4.0 and curl. If you are using a proxy, set the https_proxy variable.
Usage
Using the script is really simple. Just specify your My Oracle Support user name (normally your e-mail address), the Service Request number and the files you wish to upload. You can specify as many files as you like.
oracleFileUpload.sh <User Name> <Service Request> <File Name> <File Name> ...