title: Bash scripting rsync: rsync: link_stat (blah) failed: No such file or directory (2)
body: <p>I am trying to write a simple bash script for my local (Mac OS X) machine to move files from a directory on my machine to a remote machine. This line is failing:</p>
  
  <pre><code>rsync --verbose  --progress --stats --compress --rsh=ssh \
        --recursive --times --perms --links --delete \
        --exclude "*bak" --exclude "*~" \
        /repository/* $DEV_SERVER:$REMOTE_DIR
  </code></pre>
  
  <p><code>$DEV_SERVER</code> and <code>$REMOTE_DIR</code> are defined previously, and I echo them to verify they're accurate.</p>
  
  <p>The error I'm getting is:</p>
  
  <pre><code>rsync: link_stat /Users/myusername/mycurrentdirectory failed: No such file or directory (2)
  </code></pre>
  
  <p>To note here is that rather than using the defined directory (<code>/repository</code>, which is in the root of the machine), it uses my working directory. What is causing this?</p>