Issue
when I use this to download a file from an ftp server:
wget ftp://blah:[email protected]/"$(date +%Y%m%d -d yesterday)-blah.gz" /myFolder/Documents/"$(date +%Y%m%d -d yesterday)-blah.gz"
It says "20131022-blah.gz saved"
(it downloads fine), however I get this:
/myFolder/Documents/20131022-blah.gz: Scheme missing (I believe this error prevents it from saving the file in /myFolder/Documents/).
I have no idea why this is not working.
Solution
Save the filename in a variable first:
OUT=$(date +%Y%m%d -d yesterday)-blah.gz
and then use -O
switch for output file:
wget ftp://blah:[email protected]/"$OUT" -O /myFolder/Documents/"$OUT"
Without the
-O
, the output file name looks like a second file/URL to fetch, but it's missinghttp://
orftp://
or some other scheme to tellwget
how to access it. (Thanks @chepner)If
wget
takes time to download a big file then minute will change and your download filename will be different from filename being saved.
Answered By - anubhava Answer Checked By - Gilberto Lyons (WPSolving Admin)