# Oracle download using wget.sh

Last week I've stumbled over an unforeseen issue while trying to download a patch via MyOracleSupport(MOS) provided (dynamicscaling to be complete but that's another story)

As I tend to use autoupgrade to download and install patches etc I did not often make use of the `wget.sh` script provided by MOS or edelivery.

Nevertheless last I had to and while running

```plaintext
wget.sh
```

my download immediately failed with

```text
INFO: Output dir not specified, defaulting to current directory.
ERROR: Missing token. Provide -t <token> OR -T <token_file>.
```

Obviously the script expects something I was not aware of : An Oracle Support download token. And the download page itself does not provide an option to create one there.

#### get a token

To get a token, just open <https://updates.oracle.com/Orion/GenToken/get_token> in a browser (probably you're still logged in to MOS ;-))

Press the generate token button

![](https://cdn.hashnode.com/uploads/covers/68a583d55f110bd41decd2ed/ca73e476-d71f-4eba-95ba-458a80714eff.png align="center")

and you will get a new token which can be downloaded or copied.

![](https://cdn.hashnode.com/uploads/covers/68a583d55f110bd41decd2ed/c08b7c7e-c788-46d0-a634-a2f000c8600d.png align="center")

I tend to copy the token and create a file on the host I want to start the download from, though in the end it's up to you :-)

create a file `mos_token.txt`containing the token info.

#### run the [wget.sh](http://wget.sh)

```bash
./wget.sh -T mos_token.txt
```

if you desire passing the token directly you could do this with

```bash
./wget.sh -t '<token>'
```

As said I would recommend using the file option as there is no token available in the bash history or so.

remove the token file after download

```bash
rm mos_token.txt
```

That's it :-) Not that complicated but something you need to be aware of.

### Further reading

Token gen URL

- <https://updates.oracle.com/Orion/GenToken/get_token>
