python - How to download part of a file over SFTP connection? -


so have python program pulls access logs remote servers , processes them. there separate log files each day. files on servers in format:

access.log access.log-20130715 access.log-20130717 

the file "access.log" log file current day, , modified throughout day new data. files timestamp appended archived log files, , not modified. if of files in directory ever modified, either because (1) data being added "access.log" file, or (2) "access.log" file being archived, , empty file takes place. every minute or so, program checks recent modification time of files in directory, , if changes pulls down "access.log" file , newly archived files

all of works fine. however, if lot of data added log file throughout day, downloading whole thing on , on of data @ end of file create lot of traffic on network, , avoid that. there way download part of file? if have processed, 1 gb of file, , 500 bytes added log file, there way download 500 bytes @ end?

i using python 3.2, local machine running windows, , remote servers run linux. using chilkat making ssh , sftp connections. appreciated!

call resumedownloadfilebyname. here's description of method in chilkat reference documentation:

resumes sftp download. size of localfilepath checked , download begins @ appropriate position in remotefilepath. if localfilepath empty or non-existent, method identical downloadfilebyname. if localfilepath downloaded, no additional data downloaded , method return true.

see http://www.chilkatsoft.com/refdoc/pythoncksftpref.html


Comments