title: "Couldn't stat remote file: No such file or directory": Using FTP in shell script from *nix to Win
body: <p>I'm using a Bash script to backup my webfiles via FTP. As the title says, I have an Ubuntu webserver and am backing up to a Windows machine. I have an ssh program and FileZilla Server on the Windows machine, and can SSH and SFTP into it. The core of the script looks like this:</p>
  
  <pre><code>SRCDIR="C:\\Users\\Tech1\\testserverbackup"
  DATAIN="/var/www/html/"
  FILENAME="-r *"
  
  sshpass -e sftp -oBatchMode=no -b - ${USER}@${LANHOST} &lt;&lt; EOF
  cd  ${SRCDIR}
  lcd ${DATAIN}
  mkdir $(date -I)
  cd $(date -I)
  put ${FILENAME}
  bye
  echo made it
  EOF
  </code></pre>
  
  <p>The others vars are a bit sensitive, so I don't want to post them, but the credentials have been working for me so far. </p>
  
  <p>The error I'm getting looks like this:</p>
  
  <pre><code>sftp&gt;       cd  C:\Users\Tech1\testserverbackup
  Couldn't stat remote file: No such file or directory
  </code></pre>
  
  <p>I've ssh'd into the folder and sftp'd, so I'm not really sure what the issue is. AFAIK, cd is the native windows command, not just the FTP one.</p>
  
  <p>Any ideas what's going wrong? Thank you.</p>