-1

I want to copy all of the files and folders from one host to another. The files are on the old host site at /var/www/html.
I only have FTP access to that server, and I can't TAR all the files.

I tried running the following command form my new server:

wget -r ftp://username:password@ip.of.old.host

But the problem is that the username I have is an email address so its not registering it as a username.

For example:

wget -r ftp:// myname@gmail.com:password@ip.of.old.host

This means there are two '@' symbols. I'm not sure but I think it's reading the first @ symbol as the one used in the function.
The output Im getting is wget -r ftp://username:password@ip.of.old.host: Bad port number.

Not sure whats going on and any help is appreciated.

Reaces
  • 5,597
  • 4
  • 38
  • 46
Ryan
  • 9
  • 1
  • 1
  • A [quick](http://serverfault.com/questions/236449/how-can-i-use-wget-to-get-files-recursively-if-the-username-contains-an) [google](http://www.cyberciti.biz/faq/wget-command-with-username-password/) [search](http://superuser.com/questions/522867/wget-for-ftp-using-a-password-containing) would have given you a few dozen answers. – Reaces Dec 23 '14 at 14:33
  • I find answer in seconds using `man wget` – Archemar Dec 23 '14 at 15:05

1 Answers1

2

Try below wget options if you have special character in username.

--user='username'  --password='myPassword'

OR

--ftp-user='myname@gmail.com' --ftp-password='password'

Your wget command will be as below

wget -r --user='myname@gmail.com' --password='password' ftp://ip.of.old.host

OR

wget -r --ftp-user='myname@gmail.com' --ftp-password='password' ftp://ip.of.old.host
Vaibhav Panmand
  • 1,038
  • 7
  • 17
  • 1
    And better you put your password in a .netrc or a .wgetrc file in your home folder, so you can hide it from shell history and from ps – Zimmi Dec 23 '14 at 15:37