title: put *.* is moving only few files from local folder to SFTP
body: <p>I am trying to move all files under a folder to SFTP folder using shell script for my batch job. But every time it runs only few files are moved. Not all the files. </p>
  
  <pre><code>/usr/local/bin/expect -c "spawn sftp -o Identityfile="/export/home/user/.ssh/example.ppk" $SFTP_USERID@$SFTP_SERVER
  expect \"password: \"
  send \"$PASSWORD\n\"
  expect \"sftp&gt; \"
  send \"cd $DESTDIR\r\"
  expect \"sftp&gt; \"
  send \"lcd $LOCALDIR\r\"
  expect \"sftp&gt; \"
  send \"put *.* \r \"
  expect \"sftp&gt; \"
  send \"quit\r\"
  expect \"sftp&gt; \"" &gt;&gt; $BATCH_DIR/logs/batch"$todaydatetime".log   
  </code></pre>
  
  <p>This script runs every time succesfully but only few files are moved to SFTP destination folder. In Logs i am always seeing only 19 Files are uploaded from local folder to SFTP Folder(every time same files).
  I understand why every time same files but i am not able to figure out why only few files. </p>
  
  <p>Is there any limit on time that SFTP command will be active?</p>
  
  <p>Kindly also help me how can i change the command to take only new files. "rsynch" is not working.</p>
  
  <p>
  Hi kenster, mput didn't work for me. Files that are transferred are files under my local folder started with numbers. In my local folder there are 236 files of which 19 files that are starting with numbers are getting transferred even if there are spaces in file name or file extension is may be pdf or xls or what ever but always same 19 files are transferred MEANING not a single file that starts with alphabet is transferred.  I tried the same steps manually  to check whether file names/ permissions are causing some issue but manually is working fine : ( all files are transferred.</p>
  
  <p>Sorry Guys my mistake.</p>
  
  <p>I just added below lines after lcd step. Now only 6 files are transferred.
  expect \"sftp> \"
  send \"lls -ltr\r\"</p>
  
  <p>Issue looks like something else not with commands or file names.</p>
  
  <p>I echo <code>date '+%Y%m%d%H%M%S'</code> before and end of all steps. the programs executed only 12 secs everytime.THis should be some with my environment.I am working in restricted environment. Thanks Guys. But still can help me how to pick only new files(moving old files to backup folder is not accepted by my boss).</p>