Skip to main content

Copying files save to another machine

Project description

SFTPCopy

sftpcopy allows to copy files to or from a remote server – integrates with gocept.filestore. sftpcopy will take files from the new directory, copy them to the remote server and put them into cur on success. Likewise it will download files from the remote server and put them into the new directory for another application to pick it up.

All together this allows quite stable and asynchronous data transfer.

Changes

0.1.3 (2008-02-27)

  • Added configdict argument to main function for easier buildout integration.

0.1.2 (2008-02-18)

  • Fixed bug in connection logging.

  • Remember filestore so we can actually upload/download.

  • Did some testing predefined user.

0.1.1 (2007-11-13)

  • Fixed brown back release 0.1 which was not usable at all since there were various files missing in the archive.

TODO

  • Documentation

  • Tests!

  • Interfaces would be nice :)

SFTPCopy

Configure an sftpcopy:

>>> import tempfile
>>> import gocept.filestore
>>> import gocept.sftpcopy
>>> store_dir = tempfile.mkdtemp()
>>> filestore = gocept.filestore.FileStore(store_dir)
>>> filestore.prepare()
>>> sftp = gocept.sftpcopy.SFTPCopy(
...     'download', filestore,
...     'localhost', 22, 'test', 'D>Mx,62I', 'tmp')

After connecting …

>>> sftp.connect()

… we can download …

>>> sftp.copyNewFiles()

… and upload files …

>>> sftp.uploadNewFiles()

Those methods doe not put anything out if there is no error.

Cleanup

>>> sftp.close()
>>> import shutil
>>> shutil.rmtree(store_dir)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gocept.sftpcopy-0.1.3.tar.gz (5.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page