How to download a file and preserver original permissions using wget

How can I download a file that has already executable permissions 755 in another server.

I want to: wget https://example.com/pub/register.sh --no-check-certificate

and preserver permission register.sh 755

right now, if after I execute the above command, it change perms to 444 after file downloads. then I have to execute: chmod 700 reg7.sh ; ./register.sh

Any ideas how to do this?


Solution 1:

You can't. It's as simple as that. Unix permissions are not transferred by HTTP.

To do this, you would need to use other tools, e.g. rsync or scp.