#2789 PR closed: Show the users the starting point of the execution of the PRE/POS_RECOVERY_SCRIPTs

Labels: enhancement, won't fix / can't fix / obsolete

ivarmu opened issue at 2022-04-13 12:40:

Relax-and-Recover (ReaR) Pull Request Template

Please fill in the following items before submitting a new pull request:

Pull Request Details:
  • Type: Enhancement

  • Impact: Low

  • Reference to related issue (URL): No issue created

  • How was this pull request tested?: Local VM

  • Brief description of the changes in this pull request: Add a LogPrint to show the user the scripts are being executed

pcahyna commented at 2022-04-13 15:26:

Hi, thanks for the change, I believe it would be better to do this after PR #2735 is merged, otherwise the changes would conflict. Also, is it intentional that it is done only for PRE/POST_RECOVERY_SCRIPT and not for PRE/POST_BACKUP_SCRIPT ?
I suppose you are using the scripts yourself, could you please have a look at PR #2735 and check if it is useful for you, including the suggestion I made at https://github.com/rear/rear/pull/2735#issuecomment-1090422991 ? If you don't find any issue with that PR, I would like to merge it soon and then update and merge this one.

ivarmu commented at 2022-04-13 16:09:

I'm ok with merging that PR after #2735. The mine one is introducing only information to the output in run time... so it's OK. What I can do is to add the same Information for PRE/POST_BACKUP_SCRIPT.

What do you think?

pcahyna commented at 2022-04-14 10:28:

Yes, I would do the same change for PRE/POST_BACKUP_SCRIPT.

What do you think about the changes in PR #2735 and the suggestion in the last comment there? (I think we should gradually deprecate PRE/POST_*_SCRIPT and replace by the proposed PRE/POST_*_COMMANDS.)

ivarmu commented at 2022-04-14 11:23:

I don't agree to add that new variables, but may maintain the original ones:

  • PRE/POST_*_SCRIPT: I understand it to a unique (and external to ReaR) script to be executed as is (the original intention I think)
  • PRE/POST_*_COMMANDS: It is supposed to be able to run one or more commands, not necessarily a script. These commands are external to ReaR, too, but adds more complexity to ReaR when is not needed, as a single script can contain all the commands to be executed.

So, in my honest opinion, ReaR is not intended to re-implement a shell to parse all the shell grammar, letting to run an external script should be enough.

jsmeix commented at 2022-06-01 08:26:

I included the changes in this pull request
in my https://github.com/rear/rear/pull/2811

jsmeix commented at 2022-06-02 13:27:

With https://github.com/rear/rear/pull/2811 merged
this pull request got obsoleted by it.

jsmeix commented at 2022-06-02 13:35:

@ivarmu
thank you for your enhancement pull request!

PRE_RECOVERY_SCRIPT and POST_RECOVERY_SCRIPT
are still there and did not change how they work
so you could use any combination of
PRE_RECOVERY_COMMANDS and POST_RECOVERY_COMMANDS
and PRE_RECOVERY_SCRIPT and POST_RECOVERY_SCRIPT
according to what works best for your needs.

I think in particular for longer complicated things
it is better to have them all in separated scripts
and call them via PRE_RECOVERY_SCRIPT and
POST_RECOVERY_SCRIPT.

But to "just run a few simple commands"
PRE_RECOVERY_COMMANDS and POST_RECOVERY_COMMANDS
are likely easier to use for the user because
he can specify all in his etc/rear/local.conf
and does not need to care about external scripts.


[Export of Github issue for rear/rear.]