Mettre en place sauvegarde Borg et Borg_server et sécurité ssh

Mon serveur YunoHost

Matériel: VPS acheté en ligne et Vieil ordinateur
Version de YunoHost: 4.3.5
J’ai accès à mon serveur : En SSH | Par la webadmin
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : non

Borgserver et authentification ssh

Mettre en place Borgserver nécessite-il que l’utilisateur pour ssh d’avoir PasswordAuthentication yes dans son fichier /etc/ssh/sshd_config ?
Sachant que par sécurité je connectais avec une clé ssh et donc avais choisi PasswordAuthentication no. Ça me semble logique, ainsi que d’ajouter un utilisateur ssh…

Pour le serveur à sauvegarder avec Borg, là je peux garder une configuration /etc/ssh/sshd_config avec ``PasswordAuthentication no` ?

Est-ce que le README de GitHub - YunoHost-Apps/borg_ynh: An experimental Borg implementation for YunoHost partiellement obsolète est quand même à suivre ?

Autre chose, je crois que ce n’est pas clair pour moi…
J’ai installer Borgeserver, mais je pensais pouvoir choisir un sous-domaine pour l’application… En fait, non ? J’avais préparer un sous-domaine borgserver.mondomaine.tld et en installant Borg sur le serveur, j’ai spécifié à cette étape:
In which borg repository location do you want to backup your files ?: user@borgserver.mondomaine.tld:/remote/repository

Je suis un peu perdu ! sinon, dans quel dossier vont se faire les backups ? je voudrais le déplacer ensuite sur un disque à côté…

Sinon, je reçois ce message d’erreur:
root : /etc/sudoers.d/borg is owned by uid 989, should be 0 ; TTY=pts/0 ; PWD=/root ; USER=root ;

J’aurais du tout installer avec l’utilisateur admin peut-être et non en root ?

Bon, je crois comprendre une de mes erreurs, l’app Borg s’installe sur le serveur principal, c’est bien ça ?
Du coup j’ai essayé de corriger dans le panel de configuration ou se trouve BorgServer pour mettre le bon domaine et le port ssh ! mondomaine.tld:XXXX, pas besoin de sous-domaine ??
Par contre j’ai toujours cette erreur de sudoers… Je ne comprends pas

Bon à force de désinstaller et réinstaller, je crois que je suis sur la bonne voix !
Pour les soucis de ssh, j’ai du faire un
chown root: /etc/sudoers/borg
qui appartenait à l’utilisateur borg.
Pour l’install de Borg j’ai choisi (avec le port ssh XXXX)
ssh://user@mondomaine.tld:XXXX/~/backup
en imaginant qu’il va chercher un dossier backup dans le dossier /home/user où j’installe BorgServer, du coup j’ai anticipé avec un mkdir /home/user/backup et chown user: /home/user/backup.
J’ai du réinstaller car la première fois j’ai mal rentré le quota en voulant mettre 1.7 To, qui va plutôt être 1700G, pour que ça soit pris en compte j’ai du désinstaller des 2 côtés client et serveur et cette fois, ça a l’air de fonctionner (je confirme, puisque je vois des fichiers dans le dossier /home/user/backup) ! :slight_smile:

Juste une dernière question sur mes incertitudes au départ, je peux bien continuer à garder PasswordAuthentication no dans le fichier /etc/ssh/sshd_config puisque c’est des clés publiques ? ou bien non car il y a un mot de passe créer pour l’authentification ?

Je ne suis pas sûr encore… c’est pas simple à configurer tout ça et je suis perdu avec tous les topics sur le sujet…
J’ai eu cette erreur par mail…

The backup miserably failed to backup system configurations.



Creating a backup archive from the collected files...
The archive will contain about 656.4KiB of data.
The operation 'Create a backup archive' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20220106-000001-backup_create' to get help
Creating a backup archive from the collected files...
The archive will contain about 102.6MiB of data.
Backup created
name: auto_data
results: 
  apps: 
  system: 
    data_home: Success
    data_mail: Success
    data_multimedia: Success
    data_xmpp: Success
size: 107606823
Collecting files to be backed up for borg...
Loading installation settings...
Declaring files to be backed up...
Backup script completed for borg. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 112.8KiB of data.
Backup created
name: auto_borg
results: 
  apps: 
    borg: Success
  system: 
size: 115476
Collecting files to be backed up for coturn...
Loading installation settings...
Declaring files to be backed up...
Backup script completed for coturn. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 147.9KiB of data.
Backup created
name: auto_coturn
results: 
  apps: 
    coturn: Success
  system: 
size: 151460
Collecting files to be backed up for cryptpad...
Declaring files to be backed up...
Backup script completed for cryptpad. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 669.1MiB of data.
Backup created
name: auto_cryptpad
results: 
  apps: 
    cryptpad: Success
  system: 
size: 701582990
Collecting files to be backed up for garradin...
Declaring files to be backed up...
Declaring files to be backed up...
Backup script completed for garradin. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 3.2MiB of data.
Backup created
name: auto_garradin
results: 
  apps: 
    garradin: Success
  system: 
size: 3349148
Collecting files to be backed up for grav...
Loading installation settings...
Declaring files to be backed up...
Backup script completed for grav. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 1.1GiB of data.
Backup created
name: auto_grav
results: 
  apps: 
    grav: Success
  system: 
size: 1183340211
Collecting files to be backed up for mattermost...
Loading installation settings...
Declaring files to be backed up...
Backing up the MySQL database...
Backup script completed for mattermost. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 579.9MiB of data.
Backup created
name: auto_mattermost
results: 
  apps: 
    mattermost: Success
  system: 
size: 608058298
Collecting files to be backed up for mobilizon...
Loading installation settings...
Declaring files to be backed up...
Backing up the PostgreSQL database...
Backup script completed for mobilizon. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 271.7MiB of data.
Backup created
name: auto_mobilizon
results: 
  apps: 
    mobilizon: Success
  system: 
size: 284868467
Collecting files to be backed up for nextcloud...
Loading installation settings...
Declaring files to be backed up...
Backing up the MySQL database...
Backing up data directory...
Backup script completed for nextcloud. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 1.4GiB of data.
Backup created
name: auto_nextcloud
results: 
  apps: 
    nextcloud: Success
  system: 
size: 1540587934
Collecting files to be backed up for opensondage...
Loading installation settings...
Declaring files to be backed up...
Backup script completed for opensondage. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 15.4MiB of data.
Backup created
name: auto_opensondage
results: 
  apps: 
    opensondage: Success
  system: 
size: 16179235
Collecting files to be backed up for rainloop...
Loading installation settings...
Declaring files to be backed up...
Backup script completed for rainloop. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 22.5MiB of data.
Backup created
name: auto_rainloop
results: 
  apps: 
    rainloop: Success
  system: 
size: 23586560
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: Debian GNU/Linux 10
Traceback (most recent call last):
  File "/opt/borg-env/lib/python3.7/site-packages/borg/remote.py", line 247, in serve
    res = f(**args)
  File "/opt/borg-env/lib/python3.7/site-packages/borg/remote.py", line 375, in open
    self.repository.__enter__()  # clean exit handled by serve() method
  File "/opt/borg-env/lib/python3.7/site-packages/borg/repository.py", line 188, in __enter__
    self.create(self.path)
  File "/opt/borg-env/lib/python3.7/site-packages/borg/repository.py", line 272, in create
    with open(os.path.join(path, 'README'), 'w') as fd:
PermissionError: [Errno 13] Permission denied: '/home/user/backup/README'
Borg server: Platform: Linux rodinux.fr 4.19.0-18-amd64 #1 SMP Debian 4.19.208-1 (2021-09-29) x86_64
Borg server: Linux: debian 10.11
Borg server: Borg: 1.1.16  Python: CPython 3.7.3 msgpack: 0.5.6.+borg1
Borg server: PID: 17326  CWD: /home/user
mondomaine.tldr: sys.argv: ['/opt/borg-env/bin/borg', 'serve', '--storage-quota', '1750G', '--restrict-to-repository', '/home/user/backup\']
Borg server: SSH_ORIGINAL_COMMAND: 'borg serve --umask=077'
Platform: Linux linux07.fr 4.19.0-18-amd64 #1 SMP Debian 4.19.208-1 (2021-09-29) x86_64
Linux: debian 10.11
Borg: 1.1.16  Python: CPython 3.7.3 msgpack: 0.5.6.+borg1
PID: 29222  CWD: /home/yunohost.backup/tmp/auto_conf
sys.argv: ['/opt/borg-env/bin/borg', 'init', '-e', 'repokey', 'ssh://user@mondomaine.tld:6060/~/backup']
SSH_ORIGINAL_COMMAND: None
Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg_app
Custom backup method could not get past the 'backup' step
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: Debian GNU/Linux 10
By default repositories initialized with this version will produce security
errors if written to with an older version (up to and including Borg 1.0.8).
If you want to use these older versions, you can disable the check by running:
borg upgrade --disable-tam 'ssh://user@mondomaine.tld:6060/~/backup'
See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.
IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!
Use "borg key export" to export the key, optionally in printable format.
Write down the passphrase. Store both at safe place(s).
Failed to format translated string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: Debian GNU/Linux 10
A repository already exists at ssh://user@mondomaine.tld:6060/~/backup.
Failed to format translated string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: Debian GNU/Linux 10
A repository already exists at ssh://user@mondomaine.tld:6060/~/backup.
Failed to format translated string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: Debian GNU/Linux 10
A repository already exists at ssh://user@mondomaine.tld:6060/~/backup.
Failed to format translated string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: Debian GNU/Linux 10
A repository already exists at ssh://user@mondomaine.tld:6060/~/backup.
Failed to format translated string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: Debian GNU/Linux 10
A repository already exists at ssh://user@mondomaine.tld:6060/~/backup.
Failed to format translated string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: Debian GNU/Linux 10
A repository already exists at ssh://user@mondomaine.tld:6060/~/backup.
Failed to format translated string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: Debian GNU/Linux 10
A repository already exists at ssh://user@mondomaine.tld:6060/~/backup.
Failed to format translated string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: Debian GNU/Linux 10
A repository already exists at ssh://user@mondomaine.tld:6060/~/backup.
Failed to format translated string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: Debian GNU/Linux 10
A repository already exists at ssh://user@mondomaine.tld:6060/~/backup.
Failed to format translated string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Failed to format translated string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_applying_method_custom': 'Calling the custom backup method '{method}'...' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)
Remote: Debian GNU/Linux 10
A repository already exists at ssh://user@mondomaine.tld:6060/~/backup.
Failed to format translated string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}, raising error: KeyError('method') (don't panic this is just a warning)
Failed to format translatable string 'backup_method_custom_finished': 'Custom backup method '{method}' finished' with arguments '()' and '{}', raising  error: KeyError('method') (don't panic this is just a warning)

Pourquoi j’ai aussi ceci ? avec :

$ sudo tail -n 100 /var/log/backup_borg.err
.............
[2022-01-06_00:00:09] Remote: Debian GNU/Linux 10
[2022-01-06_00:00:09] /home/user/backup is not a valid repository. Check repo config.
[2022-01-06_00:00:21] Remote: Debian GNU/Linux 10
[2022-01-06_00:03:15] Remote: Debian GNU/Linux 10
[2022-01-06_00:03:17] Remote: Debian GNU/Linux 10
[2022-01-06_00:03:19] Remote: Debian GNU/Linux 10
[2022-01-06_00:03:27] Remote: Debian GNU/Linux 10
[2022-01-06_00:03:29] Remote: Debian GNU/Linux 10
[2022-01-06_00:03:31] Remote: Debian GNU/Linux 10
[2022-01-06_00:03:33] Remote: Debian GNU/Linux 10
[2022-01-06_00:03:41] Remote: Debian GNU/Linux 10
[2022-01-06_00:03:43] Remote: Debian GNU/Linux 10
[2022-01-06_00:03:45] Remote: Debian GNU/Linux 10
[2022-01-06_00:03:46] Remote: Debian GNU/Linux 10
[2022-01-06_00:03:54] Remote: Debian GNU/Linux 10
[2022-01-06_00:11:33] Remote: Debian GNU/Linux 10
[2022-01-06_00:11:34] Remote: Debian GNU/Linux 10
[2022-01-06_00:11:36] Remote: Debian GNU/Linux 10
[2022-01-06_00:11:44] Remote: Debian GNU/Linux 10
[2022-01-06_00:11:49] Remote: Debian GNU/Linux 10
[2022-01-06_00:11:51] Remote: Debian GNU/Linux 10
[2022-01-06_00:11:52] Remote: Debian GNU/Linux 10
[2022-01-06_00:12:00] Remote: Debian GNU/Linux 10
[2022-01-06_00:39:57] Remote: Debian GNU/Linux 10
[2022-01-06_00:39:59] Remote: Debian GNU/Linux 10
[2022-01-06_00:40:00] Remote: Debian GNU/Linux 10
[2022-01-06_00:40:09] Remote: Debian GNU/Linux 10
[2022-01-06_00:50:44] Remote: Debian GNU/Linux 10
[2022-01-06_00:50:46] Remote: Debian GNU/Linux 10
[2022-01-06_00:50:48] Remote: Debian GNU/Linux 10
[2022-01-06_00:50:56] Remote: Debian GNU/Linux 10
[2022-01-06_00:56:12] Remote: Debian GNU/Linux 10
[2022-01-06_00:56:14] Remote: Debian GNU/Linux 10
[2022-01-06_00:56:16] Remote: Debian GNU/Linux 10
[2022-01-06_00:56:24] Remote: Debian GNU/Linux 10
[2022-01-06_01:12:39] Remote: Debian GNU/Linux 10
[2022-01-06_01:12:40] Remote: Debian GNU/Linux 10
[2022-01-06_01:12:42] Remote: Debian GNU/Linux 10
[2022-01-06_01:12:50] Remote: Debian GNU/Linux 10
[2022-01-06_01:13:07] Remote: Debian GNU/Linux 10
[2022-01-06_01:13:09] Remote: Debian GNU/Linux 10
[2022-01-06_01:13:10] Remote: Debian GNU/Linux 10
[2022-01-06_01:13:18] Remote: Debian GNU/Linux 10
[2022-01-06_01:13:40] Remote: Debian GNU/Linux 10
[2022-01-06_01:13:41] Remote: Debian GNU/Linux 10
[2022-01-06_01:13:43] Remote: Debian GNU/Linux 10

Je veux bien en savoir plus sur les configurations tout de même… Est-ce que la ligne ssh://user@mondomaine.tld:XXXX/~/backup est correcte ?

Quels sont les configurations possibles avec sudo yunohost app setting borgserver -v ?

Je me demande si les histoires avec les ports à utiliser ne sont les sources de problèmes…
J’ai essayé ceci en cherchant à adapter depuis le serveur avec Borg Backup

# BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 -p XXXX -oStrictHostKeyChecking=yes " borg list user@mondomaine.tld:/~/backup
Remote: Debian GNU/Linux 10
Remote: /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Enter passphrase for key ssh://user@mondomaine.tld/~/backup: 
Warning: The repository at location ssh://borgrod@rodinux.fr/~/backup was previously located at ssh://user@mondomaine.tld:XXXX/~/backup
Do you want to continue? [yN] y
_auto_data-2022-01-06_00:00          Thu, 2022-01-06 00:00:23 [25cb653e00ecc67b635baaa9b5f9ce9e5355a3d97b539e546292ac361c015de6]
_auto_borg-2022-01-06_00:03          Thu, 2022-01-06 00:03:29 [f66ff2a27d4408c97088fd736942922708429ac9b40fe3a8ef94b14ab0dcf562]
_auto_coturn-2022-01-06_00:03        Thu, 2022-01-06 00:03:42 [194247f625e23fe3b59bf0221ebae52bde196ae1613d418e798f944147c2bc49]
_auto_cryptpad-2022-01-06_00:03      Thu, 2022-01-06 00:03:56 [e93d4a285dc89d93fb3a406672b482d2b46e3c1ba7162b166f3f590a245e6dae]
_auto_garradin-2022-01-06_00:11      Thu, 2022-01-06 00:11:45 [96824905a20adc83794e89638b408524f6c674e621fc2efb7e351e296a7b1814]
_auto_grav-2022-01-06_00:11          Thu, 2022-01-06 00:12:02 [c1ab0342cc84dae520e38e83c0b8595bb21838090a878c0e6f366c14adedad90]
_auto_mattermost-2022-01-06_00:40    Thu, 2022-01-06 00:40:10 [0998d57dbe054e6f480ceffff25c4e2558e1a5469563d65f9e6de934139fb2f1]
_auto_mobilizon-2022-01-06_00:50     Thu, 2022-01-06 00:50:58 [af0f33e456fbf3dd8049cdb8839f8527ef8cb5a41c003591386aac3e160498a6]
_auto_nextcloud-2022-01-06_00:56     Thu, 2022-01-06 00:56:26 [24df9dac1016e267ee8d54ec3aa323271debfebfc60cde83affd93b196ff7b10]
_auto_opensondage-2022-01-06_01:12   Thu, 2022-01-06 01:12:52 [b5ffe5fba950f37d421c0d4b19ea62cf1b2a9753e5cf35c6ab30633f81de4725]
_auto_rainloop-2022-01-06_01:13      Thu, 2022-01-06 01:13:20 [f5d515211741a4994d40d4397669af98a764e6f5ef03409bc33cf7338ea7c7da]

Je vois bien des backups présents. Mais, j’ai du tricher pour cette histoire de port XXXX qui est le port ssh de mondomaine.tld. À savoir que le site en question à un autre port ssh…

Après un redémarrage du l’instance ou se trouve Borg Backup, le service a l’air d’avoir démarré. J’ai mis finalement le cron à 4:00, je verrai si ça fonctionne.

$ sudo yunohost service status borg
configuration: unknown
description: Deduplicating backup program
last_state_change: 1970-01-01 00:00:00
start_on_boot: static
status: running

$ sudo systemctl status borg.service
● borg.service - Run backup borg
   Loaded: loaded (/etc/systemd/system/borg.service; static; vendor preset: enab
   Active: inactive (dead)

Bon, il suffisait de redémarrer et je peux continuer à garder l’authentification ssh avec clé publique sans accepter de mot de passe.

Bon, cette fois ça a l’air de fonctionner alors qu’étais bien remis PasswordAuthentication no dans la config ssh.
Ce que je trouve bizarre c’est comment le dossier avec les sauvegardes semblent illisible en étant sur le serveur où se situe les backups.
Alors que de l’autre serveur avec la commande BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 -p XXXX -oStrictHostKeyChecking=yes " borg list user@mondomaine.tld:/~/backup là on peut voir la liste…

Une question importante: comment faire si c’est une sauvegarde tous les jours pour que ne soit gardé que 2 sauvegardes par exemple ? Je croyais que Borg allait sauvegarder que les changements…
`

Borg works very nice, but the installation instructions could be clearer for remote backups. I could not get it to work that way. Does it run ?

I now make ‘local’ backups (from Borg-server-perspective), but the ‘local’ directory is actually a mounted remote location.

@josh in another thread did get it to work as well.

I tried to think about it, but my French is not good enough to understand the question. I think it has to do with pruning, There are examples of what happens in the Borg docs.

Yes, it works, yesterday the backup run this way, this message was sent

Creating a backup archive from the collected files...
The archive will contain about 656.4KiB of data.
Backup created
name: auto_conf
results: 
  apps: 
  system: 
    conf_ldap: Success
    conf_manually_modified_files: Success
    conf_ynh_certs: Success
    conf_ynh_settings: Success
size: 672180
Creating a backup archive from the collected files...
The archive will contain about 102.9MiB of data.
Backup created
name: auto_data
results: 
  apps: 
  system: 
    data_home: Success
    data_mail: Success
    data_multimedia: Success
    data_xmpp: Success
size: 107948524
Collecting files to be backed up for borg...
Loading installation settings...
Declaring files to be backed up...
Backup script completed for borg. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 112.8KiB of data.
Backup created
name: auto_borg
results: 
  apps: 
    borg: Success
  system: 
size: 115471
Collecting files to be backed up for coturn...
Loading installation settings...
Declaring files to be backed up...
Backup script completed for coturn. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 147.9KiB of data.
Backup created
name: auto_coturn
results: 
  apps: 
    coturn: Success
  system: 
size: 151460
Collecting files to be backed up for cryptpad...
Declaring files to be backed up...
Backup script completed for cryptpad. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 669.1MiB of data.
Backup created
name: auto_cryptpad
results: 
  apps: 
    cryptpad: Success
  system: 
size: 701587254
Collecting files to be backed up for garradin...
Declaring files to be backed up...
Declaring files to be backed up...
Backup script completed for garradin. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 3.2MiB of data.
Backup created
name: auto_garradin
results: 
  apps: 
    garradin: Success
  system: 
size: 3349148
Collecting files to be backed up for grav...
Loading installation settings...
Declaring files to be backed up...
Backup script completed for grav. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 1.1GiB of data.
Backup created
name: auto_grav
results: 
  apps: 
    grav: Success
  system: 
size: 1227673930
Collecting files to be backed up for mattermost...
Loading installation settings...
Declaring files to be backed up...
Backing up the MySQL database...
Backup script completed for mattermost. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 559.1MiB of data.
Backup created
name: auto_mattermost
results: 
  apps: 
    mattermost: Success
  system: 
size: 586216793
Collecting files to be backed up for mobilizon...
Loading installation settings...
Declaring files to be backed up...
Backing up the PostgreSQL database...
Backup script completed for mobilizon. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 272.3MiB of data.
Backup created
name: auto_mobilizon
results: 
  apps: 
    mobilizon: Success
  system: 
size: 285518750
Collecting files to be backed up for nextcloud...
Loading installation settings...
Declaring files to be backed up...
Backing up the MySQL database...
Backing up data directory...
Backup script completed for nextcloud. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 1.4GiB of data.
Backup created
name: auto_nextcloud
results: 
  apps: 
    nextcloud: Success
  system: 
size: 1540564969
Collecting files to be backed up for opensondage...
Loading installation settings...
Declaring files to be backed up...
Backup script completed for opensondage. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 15.4MiB of data.
Backup created
name: auto_opensondage
results: 
  apps: 
    opensondage: Success
  system: 
size: 16179235
Collecting files to be backed up for rainloop...
Loading installation settings...
Declaring files to be backed up...
Backup script completed for rainloop. (YunoHost will then actually copy those files to the archive).
Creating a backup archive from the collected files...
The archive will contain about 22.5MiB of data.
Backup created
name: auto_rainloop
results: 
  apps: 
    rainloop: Success
  system: 
size: 23586560

and I can see on the Borg server

# borg info /home/user/backup/
Enter passphrase for key /home/user/backup: 
Repository ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1344
Location: /home/user/backup
Encrypted: Yes (repokey)
Cache: /root/.cache/borg/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1344
Security dir: /root/.config/borg/security/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1344
------------------------------------------------------------------------------
                       Original size      Compressed size    Deduplicated size
All archives:                8.94 GB              6.25 GB              2.66 GB

                       Unique chunks         Total chunks
Chunk index:                   75890               240645

# borg list /home/user/backup/
Enter passphrase for key /home/user/backup: 
_auto_data-2022-01-06_00:00          Thu, 2022-01-06 01:00:23 [25cb653e00ecc67b635baaa9b5f9ce9e5355a3d97b539e546292ac361c015de6]
_auto_borg-2022-01-06_00:03          Thu, 2022-01-06 01:03:29 [f66ff2a27d4408c97088fd736942922708429ac9b40fe3a8ef94b14ab0dcf562]
_auto_coturn-2022-01-06_00:03        Thu, 2022-01-06 01:03:42 [194247f625e23fe3b59bf0221ebae52bde196ae1613d418e798f944147c2bc49]
_auto_cryptpad-2022-01-06_00:03      Thu, 2022-01-06 01:03:56 [e93d4a285dc89d93fb3a406672b482d2b46e3c1ba7162b166f3f590a245e6dae]
_auto_garradin-2022-01-06_00:11      Thu, 2022-01-06 01:11:45 [96824905a20adc83794e89638b408524f6c674e621fc2efb7e351e296a7b1814]
_auto_grav-2022-01-06_00:11          Thu, 2022-01-06 01:12:02 [c1ab0342cc84dae520e38e83c0b8595bb21838090a878c0e6f366c14adedad90]
_auto_mattermost-2022-01-06_00:40    Thu, 2022-01-06 01:40:10 [0998d57dbe054e6f480ceffff25c4e2558e1a5469563d65f9e6de934139fb2f1]
_auto_mobilizon-2022-01-06_00:50     Thu, 2022-01-06 01:50:58 [af0f33e456fbf3dd8049cdb8839f8527ef8cb5a41c003591386aac3e160498a6]
_auto_nextcloud-2022-01-06_00:56     Thu, 2022-01-06 01:56:26 [24df9dac1016e267ee8d54ec3aa323271debfebfc60cde83affd93b196ff7b10]
_auto_opensondage-2022-01-06_01:12   Thu, 2022-01-06 02:12:52 [b5ffe5fba950f37d421c0d4b19ea62cf1b2a9753e5cf35c6ab30633f81de4725]
_auto_rainloop-2022-01-06_01:13      Thu, 2022-01-06 02:13:20 [f5d515211741a4994d40d4397669af98a764e6f5ef03409bc33cf7338ea7c7da]
_auto_conf-2022-01-07_04:00          Fri, 2022-01-07 05:00:11 [4994e21618cc7530ed10c4b6d51651b0396ef2c1ed9502a18f24984d89ccd5a0]
_auto_data-2022-01-07_04:00          Fri, 2022-01-07 05:00:32 [bfd3a0a6e076de1c443f3d3fe3cae2ee48c37d7a9009dd7c72ad859ec49079e1]
_auto_borg-2022-01-07_04:00          Fri, 2022-01-07 05:00:49 [4bada3e9e72bb02b8c47ca42a9b51f599bb121c1e024ed58bffe144dcd360abe]
_auto_coturn-2022-01-07_04:01        Fri, 2022-01-07 05:01:05 [58a3f79ebcac81c4b9430380552e0cbe061852dea4ec2072f89aa961cafc83f5]
_auto_cryptpad-2022-01-07_04:01      Fri, 2022-01-07 05:01:22 [71e3282b01aa9095062e09bc54d3c437ee7dd0aed70387d2fe1b4d97176f35c3]
_auto_garradin-2022-01-07_04:01      Fri, 2022-01-07 05:01:46 [a08002e808f60ef05e5b4ad1cb39275fdce610df5c9d3d4179e2faf1e1fc9013]
_auto_grav-2022-01-07_04:01          Fri, 2022-01-07 05:02:01 [459a5403804fe26a11b774150db88511e384e16f31b5c04bc955338afacb7d07]
_auto_mattermost-2022-01-07_04:03    Fri, 2022-01-07 05:03:28 [142fc3eae2736f05261f01d18b3ba93e8fc5c4055b8420562bbaeac6cab81cb6]
_auto_mobilizon-2022-01-07_04:03     Fri, 2022-01-07 05:03:52 [1ab1a7480e8ff6fa6e614ded697de588589ab625bfdd7294514382895626b825]
_auto_nextcloud-2022-01-07_04:04     Fri, 2022-01-07 05:04:17 [e3f03757fc054897a255c71009f3f384fa905d1c2cf0db5aea057786a91539fd]
_auto_opensondage-2022-01-07_04:04   Fri, 2022-01-07 05:04:40 [b3632b2e0c6fa433aab5e5ee87b18e028d63e7fe64a971b1cad3c0d0af4383ea]
_auto_rainloop-2022-01-07_04:04      Fri, 2022-01-07 05:04:56 [d75656c37d785617a8fb2cb21bb8b8704d0d341fc529dbd03a5e99f337f7f42a]

So it’s nice. And yes my question was about prune or if there is a specific configuration to keep only last changes on the backups or only last 3 days for example. I have put a daily backup with 4:00
I see in the help in the command borg you can use prune. Perhaps there is yet a configuration edited ? or I need try with a --dry-run. Pehaps edit a cron or there is a file to edit on the Borg Server to make a cron ?
Or perhaps is it on the other server with Borg Backup where I can edit something about ??
O sorry, i have discover that prune is already use on the configurations. Nice ! [Résolu] [Borg] : est-ce que par défaut les anciennes archives sont effacées? https://github.com/YunoHost-Apps/borg_ynh/blob/testing/conf/backup_method

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.