Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I get broken archive when I download to the folder

I get right archive when I used command:

    wget https://mysite/published/my_archive.tar.gz

I can open this archive and use.

But I create fofder for archive

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

drwxr-xr-x   folder_for_archive

and used command for download archive to the folder:

wget https://mysite/published/my_archive.tar.gz -o "./folder_for_archive/https://mysite/published/my_archive.tar.gz"

But archive is broken and I cannot use it.
What can I do?

>Solution :

The -o argument to wget doesn’t do what you think it does:

-o logfile
--output-file=logfile
Log all messages to logfile. The messages are normally reported to standard error.

Either replace wget by curl (whose -o option does do what you expect), or use -O (capital letter O) instead:

-O file
--output-document file
The documents will not be written to the appropriate files, but all will be concatenated together and written to file.

Notice the use of plural "documents": wget is a recursive downloader, so it might produce more than one file. But in your case, it should be fine.

See the wget manual for more information on both options.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading