Command-line sftp in my Ubuntu doesn't have recursive put implemented. I found some debate from 2004 about implementing such feature with -R option switch. So I see some sort of self-made recursion as only option.
Ie.
I'm planning on doing this with bash, but any other language would suffice.
Rsync or scp is not an option because I don't have shell access to server. Only sftp.
Look at lftp. It's a powerful file transfer client which supports ftp, ftps, http, https, hftp, fish (file transfer over ssh shell session) and sftp. It has ftp-like interactive interface, but also allows to specify all commands at the command line. Look at mput
(non recursive but handles glob patterns) and mirror
(poor man's rsync) commands.
I use it with a server which only handles sftp uploads like this:
lftp -c "open -u $MYUSER,$MYPASSWORD sftp://$TARGET ; mirror -R $SOME_DIRECTORY"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With