title: How to copy files from local machine to server using SSH file transfer protocol?
body: <p>I have an Ubuntu 9.10 desktop machine which I use locally. I am setting up a server on a hosting provider. The server will run a very minimal version of Ubuntu server LTS (only LAMP and email server no GUI).</p>
  
  <p>I want to write a script (scheduled as a cron job) that will allow me to upload local files onto the server. I want to use [SFTP][1], for security reasons.</p>
  
  <p>I am new to shell scripting - but I guess shell scripting is the way to do this (unless I am mistaken).</p>
  
  <p>Can anyone provide me with the initial pointers on how to go about writing such a script, in order to SECURELY upload local files to the server?</p>
  
  <p>Ideally, I would like to compress the files before the transfer (to save on bandwidth)</p>
  
  <p>[1]: <a href="http://SSH" rel="nofollow noreferrer">http://SSH</a> file transfer protocol</p>