FtpUpload
Created 13 April 2003
FtpUpload.py provides intelligent FTP uploading of files, using MD5 hashes to track which files have to be uploaded. Each upload is recorded in a local file so that the next upload can skip the file if its contents haven’t changed. File timestamps are ignored, allowing regenerated files to be properly uploaded only if their contents have changed.
Call setHost()
and setMd5File()
to establish the settings for a session,
then upload()
for each set of files to upload.
If you want to have
removed local files automatically delete the remote files, call
deleteOldFiles()
once,
then finish()
to perform the closing bookkeeping.
fu = FtpUpload()
fu.setHost('ftp.myhost.com', 'myusername', 'password')
fu.setMd5File('myhost.md5')
fu.upload(
hostdir='www', src='.',
text='*.html *.css', binary='*.gif *.jpg'
)
# more upload() calls can go here..
fu.deleteOldFiles()
fu.finish()
More documentation (but not much more!) is in the doc strings.
FtpUpload requires:
- Python,
- Jason’s path module.
Download: FtpUpload.py
Comments
Benjamin
Add a comment: