title: How to overwrite files over FTP using command?
body: <p>I have written such a shell script which uploads files over ftp to my deployment server . This script working perfectly if you want full-deployment i.e entire project in one go . but problem is when i change specific file on local machine and now i want it to overwrite existing same file on server using ftp it's not overwriting.</p>
  
  <pre><code>MKDIR=`for directory in $FOLDERS; do echo "mkd \"${directory}\""; done`
  DELETE=`for file in $DFILES; do echo "delete \"${file}\""; done`
  ATTACH=`for file in $FILES; do echo "put \"${file}\""; done`
  
  
  IFS=$ORIGIFS
  # Send updates to server
      ftp -nv &lt;&lt;EOF
      open $FTPHOST
      user $FTPUSER $FTPPASS
      binary
      cd $FTPDIR
      $MKDIR
      $ATTACH
      quit
   EOF
  </code></pre>
  
  <p>Where: FOLDERS:contains directories to create, DELETE is string which has deleted files list , ATTACH has list of files that has been modified and needs to be overwritten on server that are exist.</p>
  
  <p>After that when i run it second time after modification in existing files  :</p>
  
  <pre><code>       local: ./testproject/trunk/test.php ./svnupdate.txt remote: ./testproject/trunk/test.php ./svnupdate.txt
         local: ./testproject/trunk/test.php ./svnupdate.txt: No such file or directory
  </code></pre>