title: Persistent non-interactive FTP session for usage in shell scripts
body: <p>I would like to script a complex scenario of file transfers from Linux to a Windows FTP server (detecting new/changed files and then transfer) and I am unable to find a command-line ftp client which supports sending files over a persistent (one time login) session on non-interactive mode. </p>
  
  <p><code>ssh/scp</code> with password-less authentication is not an option, since I have no access to the Windows FTP server.</p>
  
  <p>For example using <code>lftp</code></p>
  
  <pre><code>`lftp -u user,pass -p 21 -e "mput newfile.txt;"` 10.0.0.100 
  </code></pre>
  
  <p>will upload my file to the server, but requires authentication/handshaking to happen on every request, which takes a long time and severely slows down the transfers. </p>
  
  <p>I am wondering whether there is a way to authenticate once, establish a persistent connection and then sending the files over this connection. <code>lftp</code> and other clients are able to do this in interactive mode (connect and then perform multiple commands until quitting).</p>
  
  <p>Therefore:  </p>
  
  <ul>
  <li>Is there an FTP client on Linux which may operate like this in non-interactive mode?</li>
  <li>Alternatively, is there a way to simulate this behaviour, scripting over the interactive mode? Maybe something utilizing <code>expect</code> with <code>netcat/telnet</code> and/or named pipes?</li>
  </ul>