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

wyng-backup as python module #118

Open
Tracked by #16 ...
sylv-io opened this issue Oct 28, 2022 · 3 comments
Open
Tracked by #16 ...

wyng-backup as python module #118

sylv-io opened this issue Oct 28, 2022 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@sylv-io
Copy link

sylv-io commented Oct 28, 2022

Thanks for this awesome project. It is really reliable for such a sensitive topic like backups.

Are there any plans to convert this tool to a python module?
It would be great to be able to interact with this tool via import, instead having to of calling it with subprocess.

Background:

I'm trying to integrate this tool into a project (written in python) which automatically generates backup,
when certain conditions are met. All backup sessions are uploaded to a server, which should be able to restore and mount any volume session for inspection. (like some kind of backup time machine)

@sylv-io
Copy link
Author

sylv-io commented Oct 28, 2022

I'm going to fork this project and investigate, how complex this change would be.

@tasket
Copy link
Owner

tasket commented Oct 29, 2022

Hi @sylv-io. I've started to reduce reliance on global variables, but its not complete. For example, the 'options' obj produced by ArgumentParser is referenced frequently in a number of different functions. To use Wyng as a module currently you would have to at least supply the params for sys.argv which populate 'options' on initialization. Alas, this may only allow one action per import in its current form.

Also, any globals defined in main that are derived from the contents of 'options' may be a problem, in addition to 'l_vols' which tracks the selected storage pool for the archive.

Properly adapting Wyng for use as a module may be possible by implementing something like a 'WyngController' class which is instantiated and returned by a special constructor function.

Other tasks that may need to be done are to demarcate between internal and externally callable functions in addition to the usual handling of main().


Issue #16 also appears to require the module functionality sought in this issue.

tasket added a commit that referenced this issue Feb 7, 2023
More context when dest not ready/online, issue #138

Convert more global refs: aset, bkdir, monitor_only

Remove remote tmp dir on exit

Timeout and direct options for do_exec

Issues #118 #138
tasket added a commit that referenced this issue Feb 7, 2023
tasket added a commit that referenced this issue Feb 14, 2023
Move more path refs into ArchiveSet, issue #118

Fix duplicate prompt
@tasket tasket added enhancement New feature or request help wanted Extra attention is needed labels Feb 17, 2023
@tasket tasket added this to the v0.5 milestone Feb 17, 2023
@tasket
Copy link
Owner

tasket commented Feb 17, 2023

Looking to the near future, I'm going to try getting module support as an experimental feature in the v0.4beta.

In the meantime, I think I have made progress to where we can contemplate being able to create, say, a WyngController object that accepts an action + options and to have it function correctly. However, 'options' is still a global var of concern. The remaining globals defined in main should be OK as long as only one controller can be instantiated at a time.

@tasket tasket modified the milestones: v0.5, v0.9 Jun 15, 2023
tasket added a commit that referenced this issue Aug 27, 2023
Check map_used() when queueing unchanged vols

Localize options object, issue #118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants