Using wget on a directory outside the user's home directory
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm trying to mirror a directory via FTP with wget. The command I'm using is
wget -m ftp://user:pass@192.168.1.1/foo/bar/
But, when I run it, I get the following:
--2018-10-10 15:01:32-- ftp://user:*password*@192.168.1.1/foo/bar/
=> âÂÂ192.168.3.150/foo/bar/.listingâÂÂ
Connecting to 192.168.1.1:21... connected.
Logging in as user ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /usr/user/foo/bar ...
No such directory âÂÂfoo/barâÂÂ.
I've searched the man pages, and googled, and I can't figure it out. How do I make wget actually download the directory "/foo/bar/", and not "/usr/user/foo/bar/"?
wget ftp
add a comment |Â
up vote
0
down vote
favorite
I'm trying to mirror a directory via FTP with wget. The command I'm using is
wget -m ftp://user:pass@192.168.1.1/foo/bar/
But, when I run it, I get the following:
--2018-10-10 15:01:32-- ftp://user:*password*@192.168.1.1/foo/bar/
=> âÂÂ192.168.3.150/foo/bar/.listingâÂÂ
Connecting to 192.168.1.1:21... connected.
Logging in as user ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /usr/user/foo/bar ...
No such directory âÂÂfoo/barâÂÂ.
I've searched the man pages, and googled, and I can't figure it out. How do I make wget actually download the directory "/foo/bar/", and not "/usr/user/foo/bar/"?
wget ftp
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to mirror a directory via FTP with wget. The command I'm using is
wget -m ftp://user:pass@192.168.1.1/foo/bar/
But, when I run it, I get the following:
--2018-10-10 15:01:32-- ftp://user:*password*@192.168.1.1/foo/bar/
=> âÂÂ192.168.3.150/foo/bar/.listingâÂÂ
Connecting to 192.168.1.1:21... connected.
Logging in as user ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /usr/user/foo/bar ...
No such directory âÂÂfoo/barâÂÂ.
I've searched the man pages, and googled, and I can't figure it out. How do I make wget actually download the directory "/foo/bar/", and not "/usr/user/foo/bar/"?
wget ftp
I'm trying to mirror a directory via FTP with wget. The command I'm using is
wget -m ftp://user:pass@192.168.1.1/foo/bar/
But, when I run it, I get the following:
--2018-10-10 15:01:32-- ftp://user:*password*@192.168.1.1/foo/bar/
=> âÂÂ192.168.3.150/foo/bar/.listingâÂÂ
Connecting to 192.168.1.1:21... connected.
Logging in as user ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /usr/user/foo/bar ...
No such directory âÂÂfoo/barâÂÂ.
I've searched the man pages, and googled, and I can't figure it out. How do I make wget actually download the directory "/foo/bar/", and not "/usr/user/foo/bar/"?
wget ftp
wget ftp
asked 44 mins ago
HiddenWindshield
313
313
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
A similar question on stackoverflow (which involved java instead of wget, but really the underlying problem is with the URL syntax which is hopefully language-independent) was resolved by adding another slash and URL-encoding it, like this:
wget -m ftp://user:pass@192.168.1.1/%2Ffoo/bar/
It works for me even without encoding, just with an extra slash:
wget -m ftp://user:pass@192.168.1.1//foo/bar/
The first slash is thrown away (serving only as a separator between host and path), and the second slash actually counts as part of the path.
add a comment |Â
up vote
0
down vote
You should be able to download a specific directory using wget
like this:
wget -m 'ftp://[user]@192.168.1.1/%2ffoo/bar' -O /foo/bar
I would avoid putting your password into the URL as it will then appear in your bash history. This command of course means that /foo/bar
is located off of /
and not anywhere else. If /foo/bar
is located off of something like /var/www
you will need to include the full path in the command.
I take it you are using a UNIX-like based off of the /usr/user
so there may be differences in the function of the specific implementation of wget
you are using.
Here is an alternative using curl
:
curl -u [user] 'ftp://192.168.1.1/%2fpath/to/foo/bar' -o /path/to/foo/bar
Please read over these links:
FTP URLs
How to use wget
Using wget to recursively download FTP directories
Download using wget to a different directory than current directory
How to specify the location with wget?
Downloading file from FTP using cURL
Please comment if you have any questions or issues with this answer. I highly suggest you read through each link I have provided thoroughly before attempting the commands. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.
Best of Luck!
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
A similar question on stackoverflow (which involved java instead of wget, but really the underlying problem is with the URL syntax which is hopefully language-independent) was resolved by adding another slash and URL-encoding it, like this:
wget -m ftp://user:pass@192.168.1.1/%2Ffoo/bar/
It works for me even without encoding, just with an extra slash:
wget -m ftp://user:pass@192.168.1.1//foo/bar/
The first slash is thrown away (serving only as a separator between host and path), and the second slash actually counts as part of the path.
add a comment |Â
up vote
0
down vote
A similar question on stackoverflow (which involved java instead of wget, but really the underlying problem is with the URL syntax which is hopefully language-independent) was resolved by adding another slash and URL-encoding it, like this:
wget -m ftp://user:pass@192.168.1.1/%2Ffoo/bar/
It works for me even without encoding, just with an extra slash:
wget -m ftp://user:pass@192.168.1.1//foo/bar/
The first slash is thrown away (serving only as a separator between host and path), and the second slash actually counts as part of the path.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
A similar question on stackoverflow (which involved java instead of wget, but really the underlying problem is with the URL syntax which is hopefully language-independent) was resolved by adding another slash and URL-encoding it, like this:
wget -m ftp://user:pass@192.168.1.1/%2Ffoo/bar/
It works for me even without encoding, just with an extra slash:
wget -m ftp://user:pass@192.168.1.1//foo/bar/
The first slash is thrown away (serving only as a separator between host and path), and the second slash actually counts as part of the path.
A similar question on stackoverflow (which involved java instead of wget, but really the underlying problem is with the URL syntax which is hopefully language-independent) was resolved by adding another slash and URL-encoding it, like this:
wget -m ftp://user:pass@192.168.1.1/%2Ffoo/bar/
It works for me even without encoding, just with an extra slash:
wget -m ftp://user:pass@192.168.1.1//foo/bar/
The first slash is thrown away (serving only as a separator between host and path), and the second slash actually counts as part of the path.
answered 2 mins ago
Wumpus Q. Wumbley
4,0401120
4,0401120
add a comment |Â
add a comment |Â
up vote
0
down vote
You should be able to download a specific directory using wget
like this:
wget -m 'ftp://[user]@192.168.1.1/%2ffoo/bar' -O /foo/bar
I would avoid putting your password into the URL as it will then appear in your bash history. This command of course means that /foo/bar
is located off of /
and not anywhere else. If /foo/bar
is located off of something like /var/www
you will need to include the full path in the command.
I take it you are using a UNIX-like based off of the /usr/user
so there may be differences in the function of the specific implementation of wget
you are using.
Here is an alternative using curl
:
curl -u [user] 'ftp://192.168.1.1/%2fpath/to/foo/bar' -o /path/to/foo/bar
Please read over these links:
FTP URLs
How to use wget
Using wget to recursively download FTP directories
Download using wget to a different directory than current directory
How to specify the location with wget?
Downloading file from FTP using cURL
Please comment if you have any questions or issues with this answer. I highly suggest you read through each link I have provided thoroughly before attempting the commands. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.
Best of Luck!
add a comment |Â
up vote
0
down vote
You should be able to download a specific directory using wget
like this:
wget -m 'ftp://[user]@192.168.1.1/%2ffoo/bar' -O /foo/bar
I would avoid putting your password into the URL as it will then appear in your bash history. This command of course means that /foo/bar
is located off of /
and not anywhere else. If /foo/bar
is located off of something like /var/www
you will need to include the full path in the command.
I take it you are using a UNIX-like based off of the /usr/user
so there may be differences in the function of the specific implementation of wget
you are using.
Here is an alternative using curl
:
curl -u [user] 'ftp://192.168.1.1/%2fpath/to/foo/bar' -o /path/to/foo/bar
Please read over these links:
FTP URLs
How to use wget
Using wget to recursively download FTP directories
Download using wget to a different directory than current directory
How to specify the location with wget?
Downloading file from FTP using cURL
Please comment if you have any questions or issues with this answer. I highly suggest you read through each link I have provided thoroughly before attempting the commands. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.
Best of Luck!
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You should be able to download a specific directory using wget
like this:
wget -m 'ftp://[user]@192.168.1.1/%2ffoo/bar' -O /foo/bar
I would avoid putting your password into the URL as it will then appear in your bash history. This command of course means that /foo/bar
is located off of /
and not anywhere else. If /foo/bar
is located off of something like /var/www
you will need to include the full path in the command.
I take it you are using a UNIX-like based off of the /usr/user
so there may be differences in the function of the specific implementation of wget
you are using.
Here is an alternative using curl
:
curl -u [user] 'ftp://192.168.1.1/%2fpath/to/foo/bar' -o /path/to/foo/bar
Please read over these links:
FTP URLs
How to use wget
Using wget to recursively download FTP directories
Download using wget to a different directory than current directory
How to specify the location with wget?
Downloading file from FTP using cURL
Please comment if you have any questions or issues with this answer. I highly suggest you read through each link I have provided thoroughly before attempting the commands. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.
Best of Luck!
You should be able to download a specific directory using wget
like this:
wget -m 'ftp://[user]@192.168.1.1/%2ffoo/bar' -O /foo/bar
I would avoid putting your password into the URL as it will then appear in your bash history. This command of course means that /foo/bar
is located off of /
and not anywhere else. If /foo/bar
is located off of something like /var/www
you will need to include the full path in the command.
I take it you are using a UNIX-like based off of the /usr/user
so there may be differences in the function of the specific implementation of wget
you are using.
Here is an alternative using curl
:
curl -u [user] 'ftp://192.168.1.1/%2fpath/to/foo/bar' -o /path/to/foo/bar
Please read over these links:
FTP URLs
How to use wget
Using wget to recursively download FTP directories
Download using wget to a different directory than current directory
How to specify the location with wget?
Downloading file from FTP using cURL
Please comment if you have any questions or issues with this answer. I highly suggest you read through each link I have provided thoroughly before attempting the commands. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.
Best of Luck!
answered 2 mins ago
kemotep
1,7862617
1,7862617
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474642%2fusing-wget-on-a-directory-outside-the-users-home-directory%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password