Daily Archives: January 3, 2017

SFTP upload on one line

This can be used in a script to schedule uploads, however it is not recommended to use it and store passwords in plain text, but sometimes you might not have choice if you don’t control the remote server.

You will also need the sshpass package installed.

sshpass -p "password" sftp user@remote.com:/directory <<< $'put /var/www/www.local.com/httpdocs/var/export/*.Products.csv'