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

How to Log events on remote side? #5173

Open
bpereto opened this issue May 3, 2020 · 2 comments
Open

How to Log events on remote side? #5173

bpereto opened this issue May 3, 2020 · 2 comments
Labels

Comments

@bpereto
Copy link

bpereto commented May 3, 2020

Hi,

I'm developing currently an application for managing a borg backup server based on django. it's inspired from borgbackupserver and borgbase, but it should be open source. I wanted to make something to manage the borgbackups at home for my devices and servers in a central place with the option of selfhosting and satisfy my needs to stay informed if all my devices are backuped 😄
it will be open source when its usuable. Currently, the account/repo creation with access over ssh works. some features are missing, like logs/events, storage informations and notifications.

For this to happen: I would like to display/record when a repository is last backuped (or archive created), and display some historized storage usage informations.
If possible, also the logs of interaction with the "serve" and if some backups are failed.

is there a way to get these informations from borg serve or from the repository itself?
The only option I'm playing around is with a borg logging config, but with low yields. Accessing the repository with borg info requires a password in repokey mode, as every thing is encrypted.

a simple but not very efficient way is to regurarly du the repository for its size and get the last access or backup time from the last modifications of index.x or hints.x

Any ideas?

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented May 3, 2020

Hi @bpereto!

The problem is the fundamental mismatch here between:

  • borg doing most stuff client side and not trusting the server
  • you wanting to do stuff server side

You can see some stuff on the fs level of course, as you noted.

You can't see success status as that is only generated/emitted client side. Even there, it is not always as clear as "success" or "error", "warning" can be rather frequent and requires somebody having a look into the log output, which is not available at the server side anyway.

@bpereto
Copy link
Author

bpereto commented May 7, 2020

Yes, I see the mismatch here. Possibly, borgbackup can be extended, or usage of some post hooks like in borgmatic to send the Logs to an API (https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/).

At the moment I can detect the following:

  • Borg Repository open: lock.exclusive is created
  • Borg Repository close: lock.exclusive is removed
  • Last Access: Modification Time of repository directory (because of create/delete of lock file)
  • Last Update: Modification Time of index.*
  • Backup Usage: Usage on Filesystem

Last Update indicates some change, but there is no easy evidence of creating/deleting archives. Aditionally, the deduplication/compression information is missing.

I like that borg distrust the server, but there are situations where you possibly want those informations. The previous mentioned monitoring hooks of borgmatic looks interesting to me to send additional information.

@ThomasWaldmann ThomasWaldmann changed the title [Question] How to Log events on remote side How to Log events on remote side? Jul 7, 2020
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

2 participants