paramiko - How can I refresh the modified date of a file on the SFTP server automatically?
<p>I have a file on the SFTP server that should be imported with <strong>paramiko</strong> package on certain conditions. Until these conditions aren't fulfilled, this file should stay on the server unimported, but its modified date shoud be updated, so that this date should be always bigger than the time, at which file was checked by my import program. </p>

<p>I read the <a href="http://docs.paramiko.org/en/2.0/api/sftp.html" rel="nofollow">documentation</a> for the package but didn't found any function that could do this.</p>

<p>There's the <a href="http://docs.paramiko.org/en/2.0/api/sftp.html#paramiko.sftp_client.SFTPClient.utime" rel="nofollow"><code>utime</code> method</a>:</p>

<pre><code> utime(path, times)
</code></pre>

<blockquote>
  <p>Set the access and modified times of the file specified by <code>path</code>. If <code>times</code> is <code>None</code>, then the fileâs access and modified times are set to the current time. Otherwise, <code>times</code> must be a 2-tuple of numbers, of the form <code>(atime, mtime)</code>, which is used to set the access and modified times, respectively.</p>
</blockquote>

python sftp paramiko last-modified