I need to upload files to an SFTP server as part of an automated pipeline process (so can not be interactive). I do not have ssh access so I can not use scp or rsync.
I have had some success using the solution proposed in this answer:
sftp user@server <<EOF
put localPath remotePath
EOF
However I am looking for something a bit more solid, as I will have no indication if this fails. For example, if I wanted to download from an SFTP server I can use the following syntax:
sftp user@server:remotePath localPath
Is there an equivalent one-liner for uploading?