How to setup automatic back-up to a mounted SSD

Hello, I am running yunohost on a rpi4 and would like to set automatic back-ups on a mounted SSD, I tried with borg, but I am not sure how to use it. Also archivist seems a good idea, but the app is not maintained anymore.
On borg I am confused ofwhat to put on repository under panel configuration. The device I want to make the back-ups is filesystem /dev/sda1 and mounted on /media/storage.
Please let me know if borg is the best solutino for it.

Borg is actually in two apps: a Borg Client for your server to backup and an external Borg Server which will receive the backups.
Some documentation:

Try it out. There is no dedicated maintainer at the moment, but the Apps group tries to keep it alive. I am quite satisfied with it. (documentation)

I tried archivist, but keeps getting an error:
Errore: "500" Internal Server Error

Azione: "GET" /yunohost/api/apps/archivist/config-panel?full&locale=it

Messaggio d’errore:

Config panel question ‘encrypt’ should be initialized with a value during install or upgrade.

cf. Archivist: bug à l'ouverture du panneau de configuration - #7 by tituspijean

Another option is restic if you want a more DIY solution

  • install restic
  • make repo on backup drive
  • setup cron script to take snapshots (de-duplicated like borg)

https://restic.readthedocs.io/en/stable/index.html

I don’t fully understand that, could you help with what was done on that post to solve this problem?

@jwqos did you resolve this? I have done it and it works fine. If I can help let me know

Dj

@jwqos

  1. Mount your disk (ext4) on /media/storage and change your /etc/fstab to make it mounted at boot
  2. Install borg and answer /media/storage/backup to the repository question
  3. Wait for the first backup (depending of the frequencies you choose) OR run by hand yunohost backup create --system conf_ldap --methods borg_app
  4. You should have a green success alert on top of the config panel in side Apps > Borg > Config Panel (in the webadmin)
1 Like

Oh thanks for the help, it’s different isntalling from webadmin and terminal, only on terminal I got those options. Installing now.
I have another question, I have a 128GB pendrive for backups, but also a SSD being used for nextcloud. Can I run the backup on both drives?

Running the above command gave me this output:
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)
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)
Warning: There is already something at /media/backup.
Error: Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg_app
Info: The operation ‘Create a backup archive’ could not be completed. Please share the full log of this operation using the command ‘yunohost log share 20221016-134555-backup_create’ to get help
Error: Custom backup method could not get past the ‘backup’ step

Info: The operation ‘Create a backup archive’ could not be completed. Please share the full log of this operation using the command ‘yunohost log share 20221016-134555-backup_create’ to get help

You could do it in private if you prefer.

So your error in the log is “There is already something at /media/backup”

You probably should indicate during the install of borg app /media/backup/backup instead (or something like that). The dir /media/backup/backup should be empty before the repo was initialized.

But even after that I still get errors:

yunohost backup create --system conf_ldap --methods borg_app
Info: Creating a backup archive from the collected files…
Info: The archive will contain about 119.7KiB of data.
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)
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)
Warning: A repository already exists at /media/storage/backup.
Warning: 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)
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)
Success! Backup created
name: 20221016-141928
results:
apps:
system:
conf_ldap: Success
size: 122617

This appeared after running the command for the second time:

Warning: A repository already exists at /media/storage/backup.

It looks like and must delete the backup folder uninstall and reinstall borg.

Warning: Failed to format translated string
Warning: A repository already exists at

Those warnings are not errors, but warnings, so your backup is successfull here (but just for ldap conf)

I believe your setup is ok, wait tomorrow to see if the backup archive are listed in your borg repository.

I ran the command three times, now I have three borg repositories. I mistakenly thought the command was to create a backup, but it’s to create a backup repo, right?

No yunohost backup create creates a backup archive (and it creates the repo if needed). If the repo already exists it doesn’t recreate it (if you don’t change the address of the repo).

Strange the backup archive has only a few kb, it should be around 12GB

Its because i said you to run yunohost backup create --system conf_ldap --methods borg_app so it’s just a backup of the ldap db.

That’s why i said you to wait the true backup you planned during the installation.

But if you want to know more quicly, you can run yunohost backup create --methods borg_app

Oh thank you for the explanation, I tried, it works!

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