Use of WGET instead of downloading patches and software "manually"

-- Update July 11st, 2011 --

Use of LANG=C is now included in the scripts.

On servers where the locale is not english, the use of grep may have unintended side effects.  The script now sets this to avoid issues with customers on non-English servers.

We broke WGET for Patch Downloads.  This is NOW FIXED.

Thanks to some customers for reporting this we now know the problem and the solution.

When you see examples like this

$WGET  --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "https://updates.oracle.com/Orion/Services/download/p8534378_111060_Linux-x86-64.zip?aru=11399081&patch_file=p8534378_111060_Linux-x86-64.zip" -O $OUTPUT_DIR/p8534378_111060_Linux-x86-64.zip   >> $LOGFILE 2>&1

you will now see

$WGET  --user-agent="Mozilla/5.0" --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "https://updates.oracle.com/Orion/Services/download/p8534378_111060_Linux-x86-64.zip?aru=11399081&patch_file=p8534378_111060_Linux-x86-64.zip" -O $OUTPUT_DIR/p8534378_111060_Linux-x86-64.zip   >> $LOGFILE 2>&1


I am so sorry you have this issue. Let me know if you see it fixed in production!

----

As some of you know FTP for downloading patches went away. :-<

And as some of you might not know WGET was put in place to allow for the same access but via the security mechanisms used by Oracle.

We are working on allowing a hybrid approach to downloads via My Oracle Support.
You search and collect up what you want in My Oracle Support, but instead of downloading to your desktop (which you then might need to copy over to a server), you can copy a WGET script complete with authentication token to use directly say a unix box of your choosing (could even be an Enterprise Manager repository or staging server you defined) to get the large files.

In process for a forthcoming release (can't mention dates, releases, etc....) we want a little feedback from you.

And so you know this ALSO can include software upgrades and base software (something which is rather large depending on the product - like 10 to 80 gig!).


My question for those who use WGET....

Would you copy a script to your clipboard from say My Oracle Support (and paste into your own .sh type script which you have open in a terminal session?)
or maybe just want to copy the file to your desktop or mounted drive?
What . (dot) format would you expect the file to be in?

Any other tips or tricks you might offer for doing this kind of interaction?

See the image below for an "idea" of what we are talking about - once you have selected a list of patches and were given something like this...

What is your feedback?

-- Update July 7th - here are some updated examples of the dialog box.

Feedback, so far, indicates just the download .sh button would be probably enough.

wget more2.jpg

--- Update.....
Here is a copy of the .sh file... still a work in progress.
We hear you about Proxy setting. Will work to get that as part of this.
Will work to make it more "user readable"...

#/bin/sh

# # Generated Tue Jun 01 06:48:48 PDT 2010 # Start of user configurable variables #

# Path to wget command WGET=/usr/bin/wget

# Location of cookie file COOKIE_FILE=/tmp/$$.cookies

# Log directory and file

LOGDIR=/tmp LOGFILE=$LOGDIR/wgetlog-`date +%m-%d-%y-%H:%M`.log

# SSO username and password SSO_USERNAME=your.name@oracle.com SSO_PASSWORD=

# E-Delivery token

# The EPD_TOKEN will expire 48 hours after the following generation date # 2010-06-01 10:03:29 UTC EPD_TOKEN=ZjJQSFlNblZjcTRIaXYvNHFQWUVjUSBFUEQtZGlhcm11aWQuY2F3bGV5QG9yYWNsZS5jb20gMjI4NzUyMCBXZWxjb21lUGFnZSA4NDAgMTI3NTQxNTQwOQ@@

PASSWORD_9434145=

# # End of user configurable variable #

if [ "$PASSWORD_9434145 " = " " ]

then echo "Please edit script and set PASSWORD_9434145" exit fi

if [ "$SSO_PASSWORD " = " " ] then echo "Please edit script and set SSO_PASSWORD" exit fi

# Contact updates site so that we can get SSO Params for logging in SSO_RESPONSE=`$WGET http://updatesdemo.us.oracle.com/Orion/Services/download 2>&1|grep Location`

# Extract request parameters for SSO SSO_TOKEN=`echo $SSO_RESPONSE| cut -d '=' -f 2|cut -d ' ' -f 1` SSO_SERVER=`echo $SSO_RESPONSE| cut -d ' ' -f 2|cut -d 'p' -f 1,2` SSO_AUTH_URL=sso/auth AUTH_DATA="ssousername=$SSO_USERNAME&password=$SSO_PASSWORD&site2pstoretoken=$SSO_TOKEN"

$WGET --post-data $AUTH_DATA --save-cookies=$COOKIE_FILE --keep-session-cookies $SSO_SERVER$SSO_AUTH_URL >>

$LOGFILE 2>&1$WGET --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies

"http://updatesdemo.us.oracle.com/Orion/Services/download/p9434145_11107_Solaris-64.zip?aru=12254122

&patch_file=p9434145_11107_Solaris-64.zip&patch_password=$PASSWORD_9434145" -O 9434145_file_1 >> $LOGFILE 2>&1

$WGET --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "http://updatesdemo.us.oracle.com/Orion/Services/download/p8705958_10204_Linux-x86.zip?aru=11799041 &patch_file=p8705958_10204_Linux-x86.zip" -O 8705958_file_1 >> $LOGFILE 2>&1

$WGET --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies

"http://epd-demo.us.oracle.com/EPD/Download/process_download/A89130-01.zip?file_id=4462918&aru=4985314

&userid=your.name@company.com&egroup_aru_number=10615835&email=your.name@company.com&country_id=840

&patch_file=A89130-01.zip&userid=your.name@company.com&email=your.name@company.com&country_id=840&token=$EPD_TOKEN" >>

$LOGFILE 2>&1

# Cleanup rm -f $COOKIE_FILE


Comments:

Sounds good might consider curl also.

Posted by ÖL on July 01, 2010 at 06:11 AM PDT #

I suppose it depends on the size of the script. If the number of lines is small, either would work. If the script is long, I would prefer the download txt option.

Posted by helen on July 01, 2010 at 08:55 AM PDT #

I prefer download.txt because I can choose which patches will be downloaded using my laptop or nohup to the server

Posted by Aradha on July 01, 2010 at 11:33 AM PDT #

Or maybe as .sh so i can just chmod +x and run

Posted by Bharat on July 01, 2010 at 08:38 PM PDT #

II would prefer to just have it in the clipboard so that I can just paste it directly into a shell script on the system I wanted to run it on. I think this feature will be helpful for many users that don't need to download a lot of patches. Since we run Oracle on all the major platforms we download a lot of patches to our internal patch repository We created our own automation using some shell scripts and wget to automate both the finding and downloading of patches with just the Oracle patch number, and port identifier. orapatch-get -n 8836375 -p 197P -p 59P -p 212P -p 46P -p 226P -p 23P Enter My Oracle Support Username: USER@DOMAIN Enter My Oracle Support Password: Search Results ------------------------------------------------------------ Patch Port File name or Message ---------- -------- ------------------------------------------------------------ 8836375 197P p8836375_111070_HPUX-IA64.zip 8836375 59P p8836375_111070_HPUX-64.zip 8836375 212P p8836375_111070_AIX5L.zip 8836375 46P p8836375_111070_Linux-x86.zip 8836375 226P p8836375_111070_Linux-x86-64.zip 8836375 23P p8836375_11107_Solaris-64.zip Preparing to Download the Patches ------------------------------------------------------------ Pausing for 5 seconds, use Ctrl-C to Cancel Continuing ... Patch Port File name or Message ---------- -------- ------------------------------------------------------------ 8836375 197P Downloading: p8836375_111070_HPUX-IA64.zip 8836375 197P Download Succeeded: 1928285 Bytes, 16 Seconds 8836375 197P /oracle/patch/incoming/p8836375_111070_HPUX-IA64.zip . . .

Posted by Matt Roth on July 16, 2010 at 05:56 AM PDT #

This is exactly what Sun is doing for collections of selected patches, but when I try it, it doesn't work. It would be convenient to do, but if something changes at the Oracle end - and my short experience of being a sun Solaris administrator moving to Oracle is that Oracle aren't that bothered about keeping the website working well - then it's likely to fail, and I won't have the time or the energy to fight to get the Support people to sort it out.

Posted by Alex Swanson on October 17, 2010 at 08:09 AM PDT #

I am sorry to hear that the sun wget is not working for you. When we ship wget working in My Oracle Support, I would appreciate you giving it a try. But we haven't done the integration with Sun patches yet. This will work with Oracle patches. Try it for that. Will will expand to Sun patches once they are fully integrated with Oracle.

Posted by richard.miller on October 18, 2010 at 01:30 AM PDT #

As long as you don't (again!) break pca I'm good. Only patch solution that has ever worked for Solaris.

Posted by Peter Bonivart on January 20, 2011 at 09:25 PM PST #

It's not working now. Even from MOS wizard :(.

Posted by ZaiS on March 29, 2011 at 04:57 AM PDT #

We have made a fix to the Identity Management system which was part of a partial cutover plan. This fix was made around Noon on March 30th, PST. So if you are anyone are still having WGET issues after this time, let us know! Sorry about the bug.

Posted by richard.miller on March 30, 2011 at 05:00 AM PDT #

Richard, is this going to work on the main site when trying to download base software too?

Posted by Richard on March 31, 2011 at 02:34 AM PDT #

Good question. We have not cut over the "Updates by E-Delivery" to this method, so it doesn't participate in this. So although the patch search supports it and we go and create the right wget commands for software as part of upgrade plans, there is no generic software download version of this. I will ask if E-delivery has some form of command line or its own FTP. I will have to check.

Posted by richard.miller on March 31, 2011 at 03:21 AM PDT #

When I use the wget option there is no value in the script for EPD_TOKEN. Is this expected? When I add SSO_PASSWORD and run the script I get 401 Unauthorized in the log.

Posted by Anthony on April 02, 2011 at 01:33 AM PDT #

If you are not downloading "software" (i.e., EBS, DB, etc..) and only downloading patches you don't need the token. "EPD" stands for E-Product Delivery, so only content coming from that 'special' system needs the token. As for the 401 error, assuming your password is correct and all that it is probably a configuration problem on our end which was reported a few days ago. The "fix" apparently did not work. I will escalate this issue right now.

Posted by richard.miller on April 02, 2011 at 03:17 AM PDT #

I allways use copy to clipboard option and then paste script to *nix server vi xget.sh script, so please, do not remove that option. And indeed, good catch for that user-agent thing, I tought it was my recent password change that made scripts non-working.

Posted by Jari on April 28, 2011 at 12:35 AM PDT #

Hi, I'm not able to download patches since Mar 23rd 2011 with "WGET" option. As you suggested I've modified "--user-agent="Mozilla/5.0" in script. I tried many time but it does not download more than 4KB. Do you aware of this issue? If Yes, do you know the fix for it? Thanks,

Posted by guest on May 09, 2011 at 07:21 AM PDT #

Hi, I'm not able to download patches since Mar 23rd 2011 with "WGET" option. As you suggested I've modified "--user-agent="Mozilla/5.0" in script. I tried many time but it does not download more than 4KB. Do you aware of this issue? If Yes, do you know the fix for it? Thanks,

Posted by guest on May 09, 2011 at 07:22 AM PDT #

I got an error and it came from the language used by the OS. You should set LANG=C in the beginning of the script to be sure you grep the good word when contacting updates.oracle.com !!! regards

Posted by guest on May 30, 2011 at 01:05 AM PDT #

Appreciate the reply Richard. I've set LANG=C but it's still failing. you can see the byte size below. ################################### -rwxrwxrwx 1 xxxxx dba 2467 May 30 23:38 ptchdwnld.sh -rw-r--r-- 1 xxxxx dba 2334 May 30 23:38 wgetlog-05-30-11-23:38.log -rw-r--r-- 1 xxxxx dba 3509 May 30 23:38 p11674553_R12.AP.B_R12_GENERIC.zip [xxxxx@xxxxxx07 ~]$ [xxxxx@xxxxxx07 ~]$ vi ptchdwnld.sh #!/bin/sh LANG=C # # Generated Mon, 9 May 2011 22:23:37 Coordinated Universal Time # Start of user configurable variables # # SSO username and password SSO_USERNAME= ############## [asinoa01@sinudy07 ~]$ locale LANG=C LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" LC_PAPER="C" LC_NAME="C" LC_ADDRESS="C" LC_TELEPHONE="C" LC_MEASUREMENT="C" LC_IDENTIFICATION="C" LC_ALL= #################### Thanks,

Posted by guest@uti on May 30, 2011 at 02:04 AM PDT #

Here are the modifications I made to the script to make it work : - set SSO_USERNAME and SSO_PASSWORD to appropriate values - add export LANG=C at the beginning of the script - replace WGET=/usr/bin/wget with WGET='/usr/bin/wget --user-agent="Mozilla/5.0"' Regards Cyril

Posted by guest on May 31, 2011 at 02:37 AM PDT #

Thanks for the update Cyril WGET LOG File cat wgetlog-06-01-11-00:54.log --2011-06-01 00:54:25-- https://login.oracle.com/sso/auth Resolving login.oracle.com... 141.146.8.119 Connecting to login.oracle.com|141.146.8.119|:443... connected. HTTP request sent, awaiting response... 401 Unauthorized Authorization failed. ./test.sh: line 61: /usr/bin/wget=/usr/bin/wget --user-agent=&quot;Mozilla/5.0&quot;: No such file or directory WGET.sh file $WGET='/usr/bin/wget --user-agent=&quot;Mozilla/5.0&quot;' --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "https://updates.oracle.com/Orion/Services/download/p11674553_R12.AP.B_R12_GENERIC.zip?aru=13498268&patch_file=p11674553_R12.AP.B_R12_GENERIC.zip" -O $OUTPUT_DIR/p11674553_R12.AP.B_R12_GENERIC.zip >> $LOGFILE 2>&1

Posted by guest on May 31, 2011 at 03:01 AM PDT #

you certainly did $WGET='/usr/bin/wget --user-agent="Mozilla/5.0"' instead of WGET='/usr/bin/wget --user-agent="Mozilla/5.0"'

Posted by guest on May 31, 2011 at 03:07 AM PDT #

I modified the way you have suggest but it's still failing - set SSO_USERNAME and SSO_PASSWORD to appropriate values - add export LANG=C at the beginning of the script - replace WGET=/usr/bin/wget with WGET='/usr/bin/wget --user-agent=&quot;Mozilla/5.0&quot;' Please advice ?

Posted by guest on May 31, 2011 at 07:25 AM PDT #

Download my script from http://pastebin.com/whA5asNU and test it with your SSO_USERNAME and SSO_PASSWORD If it works as it should you'll be able to find why yours doesn't Regards

Posted by guest on May 31, 2011 at 06:01 PM PDT #

I have similar issue as reported by May 09, 2011 at 02:21 PM PDT guest. I have internal SR 3-3724732961 open as well .... Any ETA on generating working scripts for customers?

Posted by Paul Emblin on June 01, 2011 at 02:47 AM PDT #

My customer & I have the same problem as Posted by guest on May 09, 2011 at 02:21 PM PDT # Any ETA on getting working scripts for customer use?

Posted by Paul Emblin on June 01, 2011 at 03:01 AM PDT #

My customer & I have the same problem as Posted by guest on May 09, 2011 at 02:21 PM PDT # Any ETA on getting working scripts for customer use?

Posted by Paul Emblin on June 01, 2011 at 03:02 AM PDT #

wget script doesn't work for downloading patches. I get authorization failed error all the time.

Posted by Anil on June 01, 2011 at 02:13 PM PDT #

I used the test script posted by guest on June 01, 2011 at 01:01 AM PDT and it worked. I then added the wget commands to get the actual files to this test script and removed --user-agent switch from the actual commands and it seems to be working. I think the issue with the current script is that the first authentication WGET statement doesn't have user agent mentioned and hence the initial authentication failed.

Posted by Anil on June 01, 2011 at 02:26 PM PDT #

thats why i modify the WGET variable and don't add the switch --user-agent="Mozilla/5.0" on the commands executed to be sure that it's used each time

Posted by cscetbon on June 01, 2011 at 06:51 PM PDT #

wget download doesn't work for me. Instead of 1.9GB 10_Recommended_CPU_2012-01.zip i get :
-rw-r--r-- 1 elvis 3511 Jan 27 13:46 10_Recommended_CPU_2012-01.zip

and content is

head 10_Recommended_CPU_2012-01.zip

<html><body onLoad="document.myForm.submit()"><noscript><p>JavaScript is required. Enable JavaScript to use OAM Server.

Posted by guest on January 27, 2012 at 05:04 AM PST #

Interestingly, although i couldn't "force" Solaris and wget to download Recommended patches, download worked flawlessly on RedHat linux.

$wget --version
GNU Wget 1.10.2 (Red Hat modified)

BTW 10_Recommended_CPU_2012-01.zip is bugged, Oracle forgot to put patch_order file in zip.

Posted by guest on January 30, 2012 at 01:57 AM PST #

patch_order was missing because unzip in sol_10_1009 has problems with big zips. After patching with 10_Recommended_CPU_2011-10, patch_order "magically" appeared in 10_Recommended_CPU_2012-01/ folder. Before, with stock unzip i was getting some error about some 76 bytes missing or extra in zip file.

Posted by guest on January 30, 2012 at 02:15 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
5
6
8
9
10
11
12
13
14
15
17
18
19
20
21
22
23
25
26
27
28
29
30
   
       
Today