Friday, September 28, 2012

Background download of Oracle products in linux

Based in the excellent work in http://only4left.jpiwowar.com/2009/02/retrieving-oracle-patches-with-wget/ here is a way to download Oracle products in background (that means you can leave the Linux overnight and find the files ready next morning).

1. create a bash file downloadOra.sh and paste the following:


#!/bin/bash
function getOraPatch {
fname=`echo $1 | awk -F"=" '{print $NF;}'`;
wget --no-check-certificate --http-user YOURLOGIN --http-passwd YOURPASSWORD $1 -O $fname;
}
getOraPatch $1



2. chmod +x downloadOra.sh


3. to start downloading just call the script in NOHUP and background mode with only one argument: the URL you get when you are in OracleSupport (right click in the download button of each file -- see http://only4left.jpiwowar.com/wp-content/uploads/2009/02/downloadpatch-300x129.png). For example:
Pls note the quotes (') around url...

nohup ./downloadOra.sh 'PASTE_HERE_THE_URL'&
Call that script multiple times for every file to have a parallel background downloading.

Ok, shameless plug, the only innovation of this post is about hardcoding the Oracle Support credentials (so the whole process does not need to ask them from user) and calling the script in the background and executing even when you are logged out.

No comments: