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

Unclear location for user-callback #1100

Closed
hjgode opened this issue Jul 26, 2020 · 5 comments
Closed

Unclear location for user-callback #1100

hjgode opened this issue Jul 26, 2020 · 5 comments
Labels

Comments

@hjgode
Copy link

hjgode commented Jul 26, 2020

Some times ago my user-callback stopped working and I did not get an email send using sendmail. The reason was clear, there was a password change I need to enter in the script. But which one? I found several backintime user-callback files and it is unclear which one is used by BiT.
Locations found:
~/.config/backintime/user-callbak
/etc/backintime/user-callback
/root/backintime/user-callback

Finally I found the root one was used (I am running backintime Qt as root to get privilged files backed up).

Enhancement request: Note the user-callback location in syslog, not only the file name

@aryoda
Copy link
Contributor

aryoda commented Sep 11, 2022

Perhaps an additional command-line argument would be possible too...

Generally: Errors in the user-callback script should be reported back to the user somehow (I am not sure, if and how good the current implementation is here).

@aryoda
Copy link
Contributor

aryoda commented Sep 12, 2022

@emtiu Could you please add "user-callback" label?

I will implement this FR the next days with the easiest possible implementation (calling logger.info() in backintime.py and app.py)...

@emtiu
Copy link
Member

emtiu commented Sep 12, 2022

We should also check if the documentation is any help with the question of which user-callback script is called.

Also note that #827 is related, but probably much more difficult to implement.

@aryoda
Copy link
Contributor

aryoda commented Sep 12, 2022

#827 fits good here, you have earned the golden badge of "issue management" ;-)

Perhaps I could fix #827 together with #1292 since the user-callback script is also called with Popen()...

@aryoda
Copy link
Contributor

aryoda commented Sep 15, 2022

I have found that the complete call of the user-callback script file (incl. actual args) is already covered by a logging output (logger.debug) that is enabled with the --debug command line argument:

https://github.com/bit-team/backintime/blob/master/common/plugins/usercallbackplugin.py#L46

The logging output is quite self-explanatory:

...
DEBUG: [plugins/usercallbackplugin.py:46 UserCallbackPlugin.callback] Call user-callback: /home/xxx/.config/backintime/user-callback 1 Main profile 5
...

So I suggest to not add further logging output but

  1. Add FAQ section to explain how to enable full (debug) logging if problem diagnosis is required.
    I could change the log level to logger.info but this would unnecessarily flood the output (which is not only written to the syslog but also to the console)

  2. Finalize my PR Release candidate for FR #1100 (unclear user-callback location) #1295 to write the user-callback script location within the version and "about" output.

Edit: I just realize that the arg passing could require quoting (bug?):

./user-callback 1 Main profile 5 is processed in the script via profile_name="$2" and echo "Profile name: $2" results in Main but should be Main profile 5!

Edit 2: All-clear: The arguments are logged without quotes, but the Popen call gets a list of arguments and does quote it correctly. So the logging does not correspond to the real command line send to bash...

@emtiu emtiu closed this as completed in 56e7226 Sep 20, 2022
emtiu added a commit that referenced this issue Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants