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

[enhancement] [callback] add level 9 - all done #648

Open
kdupke opened this issue Oct 18, 2016 · 7 comments
Open

[enhancement] [callback] add level 9 - all done #648

kdupke opened this issue Oct 18, 2016 · 7 comments
Labels
Feature requests a new feature HELP-WANTED Used by 24pullrequests.com to suggest issues User-Callback

Comments

@kdupke
Copy link

kdupke commented Oct 18, 2016

I learned to use the callback script to wake-on-lan the backup system, but miss a hook to power off the backup system after backup.

The last cal to the callback script is level 8, but this is before umount so I can't use it for poweroff.

That said I appreciate a callback level 9, when all is done just before or after releasing all stuff.

@Germar
Copy link
Member

Germar commented Oct 18, 2016

What about starting your shutdown command detached with a delay of 30sec?

@kdupke
Copy link
Author

kdupke commented Oct 18, 2016

That is the workaround I'm using at the moment. But it does not handle errors very well.
It isn't a clean solution.
Looking at the code it looks like there is an 'unlock' at the end of the backup, which could be the point of the callback.release entry. Unfortunately I never did python yet, else I could propose code.

@kdupke
Copy link
Author

kdupke commented Oct 22, 2016

Just in case, today I tried to change the time of daily backup. I started backintime-qt4, opened the config dialog and tried to change the time.

However, when I open the config dialog it calls the callback on level 7 and when clicking OK it calls callback with level 8.

So both are not really suitable for a WOL and Powerdown. Level 7 does not harm as it wakes up a server already up. But level 8 is bad as it calls the delayed shutdown while backintime is still up.

Conclusion: backup power management needs separate treatment.

@Germar
Copy link
Member

Germar commented Oct 22, 2016

Hmm. So we would also need to check if either GUI is showing that profile or a snapshot for the profile is still running before launching that new callback event...

@kdupke
Copy link
Author

kdupke commented Oct 23, 2016

Not really. Might be the idea of using user-callback for this feature isn't the right thing.

Or the handling within the GUI could be enhanced.

Let me start more basic, think about a remote server not available before powering on.

If I start the GUI, then I might not need the remote system because I want to change the config, or just check something.

So the process could be:
GUI:
Start GUI, load local data, ask if the remote data (aka backups) should be loaded, if so start the remote system. If not, then only display what's local. Of course starting remote could be automated, showing a message 'starting remote' (of course, start up needs some time, a 'just user' could assume something is wrong).

If I change something which has to be stored on the remote (AFAIK config change, right?), and the remote isn't available, ask for starting remote and wait for it to be done.

After all, when I leave the GUI and the remote was powered on, then power it off.

As for the command line this is much easier, right? Some of the commands need the remote to be available, in which case the remote needs to be powered on. And if powered on then power it off at the end (using callback does not really works because of the way subshells are handled and waited for an SSH to finish).

That said, might be the idea of using callback to fulfill remote power management is wrong?

@Germar
Copy link
Member

Germar commented Oct 23, 2016

Yeah, I already have plans for making a new mode for custom mount commands. This will use the same method to recognize in-use mounts like the other modes already do. user-callback isn't the right place for this either.

But for GUI the remote MUST be available. Pressing OK in Settings will always result in a check of the new config which will fail if the destination is not available. Also you will not see anything useful without destination in the main window. No snapshots, no logs, no files...

Just imagine opening and closing GUI while a new snapshot is running. This would shutdown the remote host while the snapshot is still running. That's why we need to check if any process is still using the remote host. And this has to work even for different profiles (two or more profiles could use the same remote host).

@buhtz
Copy link
Member

buhtz commented Sep 12, 2024

Could be solved together with #1869 "Feature: postUnmount plugin callback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature requests a new feature HELP-WANTED Used by 24pullrequests.com to suggest issues User-Callback
Projects
None yet
Development

No branches or pull requests

4 participants