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

vorta --create should block and return borg exit status #1380

Open
drws opened this issue Aug 4, 2022 · 5 comments · May be fixed by #1656
Open

vorta --create should block and return borg exit status #1380

drws opened this issue Aug 4, 2022 · 5 comments · May be fixed by #1656
Assignees
Labels
help wanted This issue is available, comment if you want to fix it type:enhancement Improvement of an existing function

Comments

@drws
Copy link

drws commented Aug 4, 2022

Describe the bug

Currently vorta --create Profile signals Vorta to start Borg and exits immediately. By doing so it cannot signal back when the backup is finished and whether it finished successfully. I'm thinking that vorta --create should be blocking during Borg run and return its exit status to make it more informative overall and to provide blocking ability for scripts that need it. Users that don't want it can still fork the process rather easily. Or an additional switch could be added to only signal Vorta and exit immediately (as is the current behavior), vorta --start --create Profile for example.

Environment (please complete the following information):

  • OS: Arch Linux
  • Vorta version: 0.8.7
  • Installed from: OS repository
@real-yfprojects real-yfprojects added type:enhancement Improvement of an existing function help wanted This issue is available, comment if you want to fix it labels Aug 5, 2022
@real-yfprojects
Copy link
Collaborator

I aggree that blocking and returning a proper status code would be an enhancement.

@diivi
Copy link
Contributor

diivi commented Mar 15, 2023

I would like to work on this, please assign it to me 😄. Also, can you help me understand how I can block vorta instead of exiting? This should be done while the vorta window is open, and then close it when the task completes by using some sort of signal right?

@diivi
Copy link
Contributor

diivi commented Mar 15, 2023

I looked through the code, in application.py::create_backup_action(), self.jobs_manager.add_job(job) this lines seems to be adding the job for vorta to execute. As this is a BorgCreateJob, I will know that the event is completed from the create.py::finished_event() method right? Now should I add another parameter to this job during creation that will inform me whether it was created normally or via the command line from another instance? I can check for this parameter in the finished_event() method and maybe send a message to the other instance that will inform it about any errors in execution?

@diivi
Copy link
Contributor

diivi commented Mar 16, 2023

Hey @real-yfprojects, I might need two instances of vorta to be open while the backup is running. How do I send a message from the main instance to the instance that was created by the command line? This is needed to inform the second instance that a backup was completed/ errored.
I see that the qt_single_application.py::sendMessage() method only sends a message to the main instance.
self.app.isRunning() returns False from the main instance even when another instance is open.

@real-yfprojects
Copy link
Collaborator

I will know that the event is completed from the create.py::finished_event() method right? Now should I add another parameter to this job during creation that will inform me whether it was created normally or via the command line from another instance?

You can connect to BorgJob.result instead.

self.app.isRunning() returns False from the main instance even when another instance is open.

You shouldn't need isRunning.

How do I send a message from the main instance to the instance that was created by the command line?

You have to implement a new method e.g. reply that uses _inSocket to answer.

@diivi diivi linked a pull request Mar 16, 2023 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted This issue is available, comment if you want to fix it type:enhancement Improvement of an existing function
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants