wget stops downloading: Cannot write to `-' (success)

3

1

Please have in mind that I don't know anything about servers, nor any of its vocabulary, I am a simple web coder, trying to figure my way on the universe.

I'm trying to link dropbox on my server, I am using this line of code:

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

When I run it, it shows me the error:

Cannot write to `-' (Success).

I am puzzled and I don't know what to do. My CentOS is 64 bit, version 6.5.

DCV_Diego

Posted 2014-11-24T04:18:06.463

Reputation: 31

Do you have write permissions to the ~ directory? Does touch foo give you an error? – Andreas F – 2014-11-24T07:10:14.350

as I've said, I don't know anything about servers, can you please be more specific? – DCV_Diego – 2014-11-24T22:57:34.593

Learing how CentOS works and specifically how file permissions work would be a good starting point. Good luck.

– Andreas F – 2014-11-25T06:39:56.437

Answers

1

When you use - as the parameter of the option -O it represent the standard output.

You are using a pipeline so both commands are executed in parallel and the standard input of the tar command is bound to the standard output of the wget command.

The tar command is broking the pipeline so wget can not write to standard output.

When this happens, check the error messages before Cannot write to (backtick)- (Success). You might see there the cause of the error of the second command.

yucer

Posted 2014-11-24T04:18:06.463

Reputation: 911

0

First of a brief breakdown of the command you're using.

cd ~ - will descend you to your "home" directory (~ is a variable)

wget -O - will download the file

tar -zxf - will unpack downloaded file

Try the step-by-step approach. In terminal type following:

    1. cd ~ and type pwd (your location should be something like /home/username)
    1. wget https://dl.dropboxusercontent.com/u/17/dropbox-lnx.x86_64-2.10.52.tar.gz (Notice I included the full path to the file, unlike yours in the description)
    1. tar xzf dropbox-lnx.x86_64-2.10.52.tar.gz

TIP: To test if you have write permissions on a specific folder, simply "cd" to that folder and type: "touch test". If you have write permissions it should create an empty file called test in that folder

Hope this helps

Cheers! Deeh

Deeh

Posted 2014-11-24T04:18:06.463

Reputation: 204