- I download all files in remote dir1/.
- They are downloaded to a directory which contains hundreds of files.
- I need to copy the file to a remote "archive" directory.
- I need to delete the file from dir1/ (above).
I'm having trouble finding a way to transfer a file from dir1/file to dir2/ using sftp protocol.
I"ve tried lftp
because I need to provide password non-interactively, and public/private keys aren't available for me. sftp
's rename
is available, but it requires public/private key auth.
I cannot use lftp
's ftpcopy
, cp
, or mv
. In the man page, get
seems promising:
get README -o ftp://some.host.org/debian-dir/
But authentication fails (assume "no password").
Because I am using the same server, it would be nice if lftp
just used the same credentials that I am currently using to log into the current server. But alas...
Is there a way to use a password for get
command? Is there a better way to do this?
I do not believe that rsync
is helpful here...
If it helps, I believe that the SFTP server is a Windows box.
sftp
, see stackoverflow.com/questions/5386482/…copy
on Windows).sftp
to thesftp
server.sshpass
and we are considering this as an alternative option. I was just wondering if there was any other way that I had not yet considered.sshpass
? Why it's only alternative for you? Please make your question more clear. Also do you need to copy (get
) or move the file? Why cannot you uselftp
'smv
command?