lftp: how to copy file on remote server

Solution 1:

from the man page:

ftpcopy
Obsolete. Use one of the following instead:
    get ftp://... -o ftp://...
    get -O ftp://... file1 file2...
    put ftp://...
    mput ftp://.../*
    mget -O ftp://... ftp://.../*
or  other  combinations  to  get FXP transfer (directly between two ftp
servers).  lftp would fallback to plain copy (via client) if FXP trans-
fer cannot be initiated or ftp:use-fxp is false.

so you can copy a file, by doing:

get filename -o ftp://user@ftpsite/directory/copyoffile

perhaps that will work better than a put/get if only because you'll be doing something like FXP, and the server will be using its own local bandwidth

Solution 2:

from automated bash script:

lftp -u login,password some.host.com -e "put file ; exit "

and from lftp's interactive shell:

put localFileToBeSent