Skip to content

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

Open

Description

@drws

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

Activity

  1. added
    type:enhancementImprovement of an existing function
    help wantedThis issue is available, comment if you want to fix it
    on Aug 5, 2022
  2. real-yfprojects commented on Aug 5, 2022

    @real-yfprojects
    Collaborator

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

  3. diivi commented on Mar 15, 2023

    @diivi
    Contributor

    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?

  4. diivi commented on Mar 15, 2023

    @diivi
    Contributor

    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?

  5. diivi commented on Mar 16, 2023

    @diivi
    Contributor

    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.

  6. real-yfprojects commented on Mar 16, 2023

    @real-yfprojects
    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

help wantedThis issue is available, comment if you want to fix ittype:enhancementImprovement of an existing function

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions