Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to make code usable as a Python module #4

Open
mittsh opened this issue Aug 31, 2013 · 3 comments
Open

Refactor to make code usable as a Python module #4

mittsh opened this issue Aug 31, 2013 · 3 comments

Comments

@mittsh
Copy link
Owner

mittsh commented Aug 31, 2013

We should be able to use db-s3-backup from a Python script with an interface that looks like:

from db_s3_backup import backup

b = backup(config_file)
b.backup()         # to backup locally and push
b.backup_local()   # to backup locally only
b.backup_remote()  # to backup in a tmp file, push and delete the file

or

from db_s3_backup import backup

b = backup(backup_directory)

# configure manually the database
b.configure_database(database_config_dictionary)

# configure manually AWS
b.configure_aws(aws_config_dictionary)

b.backup()
@pezon
Copy link

pezon commented Aug 4, 2015

really like this. it shouldn't be difficult to make an API like this available. have you spent any more time on this module, @mittsh?

@pezon
Copy link

pezon commented Aug 4, 2015

a good API method would be to push any file descriptor whats so ever, so a user may be able to construct their own serialized backups, i.e., mongo collections.

@mittsh
Copy link
Owner Author

mittsh commented Aug 4, 2015

@pezon absolutely, it would be nice to have at least 2 levels of controls:

  • an almost automatic one, that handles all file writing and stuff
  • a low lever one, where you can pass fds
    Though, not sure if it's worth it. As you mentioned in Leverage bakthat library #7 there's bakthat, it may do the same job almost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants