Transfering files between two hosts

Escape

Can't get enough of FH
Joined
Dec 26, 2003
Messages
1,643
My lack of SSH skills are letting me down here!

Is it possible to connect to my webhost(using SSH with Putty) and transfer a file to another ftp/web server?

The searches I've done show how to upload files from your own PC, but I need to know which commands to use once I've connected to the web server.

Once I was connected, I used:
ftp <server address>

and connected to the ftp server... but I couldn't tell if I was still connected to my webhost aswell or not. If I was, how can I switch between them?

Any help or links to relevant material will be appreciated ;)
 

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
can't you download the files to your computer with an ftp program, like cute ftp or whatever, then connect to your other server and upload them? :)
 

Lazarus

Part of the furniture
Joined
Dec 22, 2003
Messages
2,874
there are ways of doing this with pure ftp.

However, it is kinda cumbersome.

Map a drive to your "destination" ftp site (if that is possible) - for example drive G

Login to your ftp site as normal. In ftp type

lcd G:\

this changes your "local" directory to G:\

If you have subdirectories on the G:\ then you can use the CD command to change to those directories.

now simply use the mget command to pull your files from your original host to the detination host.



g'luck
 

Danya

Fledgling Freddie
Joined
Dec 23, 2003
Messages
2,466
Assuming I'm not misreading this...
You have a shell on your webhost (accessable via SSH).
You have an ftp server you want to send to.
You have some files on your webhost.

Given that:
SSH to your webhost.
Switch the the directory with the files you want to transfer (may be the default). You can switch directory with cd <dir> and list files with ls.
Type ftp <server>, you'll connect to the ftp server from the SSH host.
Type bin to switch to binary mode (if uploading anything but text), or asc if uploading text (txt, html, xml).
Type put <filename>, the file will be FTPed up to the server from your webhost.
Repeat till done
When finished type quit, you'll disconnect from the FTP server.

You can send multiple files with wildcards using mput <files> as well.

You are connected to your SSH throughout this, you just connect from there to the FTP server.
 

Users who are viewing this thread

Top Bottom