vorta
vorta copied to clipboard
vorta --create should block and return borg exit status
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
I aggree that blocking and returning a proper status code would be an enhancement.
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?
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?
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.
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()returnsFalsefrom 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.