How to transfer files with LFTP


SSH into the Server

ssh yen.stanford.edu

CHANGE DIRECTORY TO DOWNLOAD OR UPLOAD DIRECTORY (this is on your receiving machine)

cd /zfs/projects/faculty/hello-world/PROVIDER

ENTER INTO A SCREEN TO RUN JOBS IN THE BACKGROUND.

** Note, to use screen, you need to use the same server like yen1.

To create a screen

screen -S helloWorld

To detach from a screen hit ‘CTL-a’ and then press ‘d’. So essentially simultaneously pressing the “Control” key and the “a” key, then releasing and then pressing the “d” key.

To reattach to the screen

screen -ls

Find the PID of the screen you want to reattach to. For example, the PID could be 12345.

screen -R 12345

CONNECT TO THE PROVIDER FTP SERVER

lftp sftp://userName@someFTPserver.com:22

At the password prompt enter in the password

someEpicPassword

DOWNLOAD FILES FROM PROVIDER

Navigate to the download folder.

cd /foo/bar

To see files in a folder

ls

To download a single file

get filename.bla

To download a batch of files

mget *.csv

UPLOAD TO PROVIDER

Navigate to the upload folder.

cd ToTU

To upload a single file

put filename.bla

To upload a batch of files

mput *.csv

UNCOMPRESS FILES

Within the folder that holds the zip files. For one file.

unzip fileName.zip

For multiple files use quote around the wildcard filename.

unzip "*.zip"