[paramiko] copying only recent files from one machine to another.

Manpreet Singh Khurana manpreetsk at gmail.com
Thu Mar 22 04:12:35 PDT 2007


First of all let me tell you that get and put function do not throw
exceptions. If you read the Paramiko API document it states that the
exceptions will be "passed through".
I dont think there is a API in python which can do stateful file
fetching, though what you can do is that you tokenize your file

Tokanize your file with  the field separator bu using "split" API and
then store the last timestamp in a external file . In the next fetch
compare with the stored TS with the new TS and if new TS is less than
the stored value skip it else fetch it and update the file with this
new TS.

Manpreet

On 3/22/07, kadarla kiran kumar <kadarlakiran at yahoo.com> wrote:
> Hi Everybody,
>
> Iam trying to copy files from one machine to another over SFTP connection.
> For that Iam using sftp.get & sftp.put methods.
>
> Now, I have to copy only recently created/modified files,i.e, based on
> timestamps from remote machine to my machine. Is there any standard
> implementation for that in python/paramiko ? If not , can anyone suggest me
> the efficient method to implement the same.
>
> Thanks in Advance,
> Kiran Kumar
>
> ________________________________
> Get your own web address.
> Have a HUGE year through Yahoo! Small Business.
>
>
> _______________________________________________
> paramiko mailing list
> paramiko at lag.net
> http://mail.lag.net/mailman/listinfo/paramiko
>



More information about the paramiko mailing list