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)
Problem
Solution
BORG_REPO
env var instead of using$repo
all over the placelogging.conf
file, and the corresponding env var to manage logs instead of using| tee -a
borg prune -P
withborg prune --glob-archives "regex"
because -P is deprecated, and it should fix the mess about pruningapp
andapps__2
(tested on my side by spammingsystemctl start borg.service
)--stats
and--list
to have more infos in logsbackup-with-borg
(I think there was a problem here, after a restore thebackup-with-borg
file shouldn't exist if I read the code correctly)/var/log/$app/borg.log
to the ynh service to be able to see the logs in the webadminPR Status
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)