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

Misc improvements #163

Merged
merged 6 commits into from
Jun 25, 2024
Merged

Misc improvements #163

merged 6 commits into from
Jun 25, 2024

Conversation

kay0u
Copy link
Member

@kay0u kay0u commented Jun 21, 2024

Problem

  • Description of why you made this PR

Solution

  • Use BORG_REPO env var instead of using $repo all over the place
  • Use logging.conf file, and the corresponding env var to manage logs instead of using | tee -a
  • Replace borg prune -P with borg prune --glob-archives "regex" because -P is deprecated, and it should fix the mess about pruning app and apps__2 (tested on my side by spamming systemctl start borg.service)
  • Avoid a false error message about repo already exists
  • Add --stats and --list to have more infos in logs
  • Backup/restore backup-with-borg (I think there was a problem here, after a restore the backup-with-borg file shouldn't exist if I read the code correctly)
  • Add the log file /var/log/$app/borg.log to the ynh service to be able to see the logs in the webadmin

PR Status

  • Code finished and ready to be reviewed/tested
  • The fix/enhancement were manually tested (if applicable)

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

@kay0u kay0u requested review from zamentur and Salamandar June 21, 2024 19:26

# We prune potential manual backup older than 1 year
"$borg" prune "$repo" --keep-within 1y 2>&1 >/dev/null | log_with_timestamp
"$borg" prune --list --keep-within 1y
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kay0u I'm not very fond of pruning without the user being informed ?
Shouldn't this "1y" be a setting in the config panel, set to "never" by default ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was already there, it's a discussion for another PR. To me it's very reasonable to have pruning by default because you don't want backup to just pile up and eat space forever. 1 year is a reasonable value ... Most of the time when you need to restore a backup, you need one from say a few days ago ...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand your point. It should at least be mentionned somewhere in the post-install notes for instance.
I'll try to see if I can work on this small matter.

@ericgaspar ericgaspar merged commit 285999f into testing Jun 25, 2024
@ericgaspar ericgaspar deleted the enh/use-repo-and-logging-env-var branch June 25, 2024 07:19
@ericgaspar ericgaspar mentioned this pull request Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants