title: Make SFTP script silent
body: <p>I've currently got a SFTP script that uploads the latest version of a file to a server via SSH  which runs on a cron daily. However I always get emails like this (I changed the server to example.com fyi)</p>
  
  <pre><code>/etc/cron.daily/backup:
  Connected to example.com.
  Connected to example.com.
  </code></pre>
  
  <p>The relevant part of the script looks like this:</p>
  
  <pre><code>    sftp -o "IdentityFile=~/.ssh/backup" -q backup@example.com &gt; /dev/null &lt;&lt; COMMANDS
          cd weekly
      put /srv/backups/daily/$INSTANCE-$(date +%Y%m%d).tgz
      quit
      COMMANDS
  </code></pre>
  
  <p>It does this twice since it's in a for loop and replaces the <code>$INSTANCE</code> variable with two different names, thus the two <code>Connected to example.com.</code> messages in the cron.</p>
  
  <p>I'd prefer not to print everything to <code>/dev/null</code> since I'd like to get errors in my email. The thing I can think of is by piping to grep and greping for error or failure or something. Is that the only possible alternative?</p>
  
  <p>Any help would be great!</p>