How do you backup your YunoHost server?

In order to understand how you back up your servers and specifically for non-standard methods, please could you answer to this poll and give details if you use custom methods?

How do you backup your ynh instances ?
  • I don’t backup my ynh
  • I don’t backup my ynh, but i use synchronisation (like imap or nextcloud client)
  • I don’t backup my ynh, but i use snapshot
  • I backuped by hand by downloading the ynh tar archive for the last month
  • I backuped by hand by cloning the disk or sd card for the last month
  • with borg_ynh on a remote server
  • with borg_ynh on a local external disk
  • with borg_ynh on the same disk
  • with restic_ynh on a remote server
  • with restic_ynh on a local external disk
  • with restic_ynh on the same disk
  • with archivist_ynh on a remote server
  • with archivist_ynh on a remote server with fallback_ynh
  • with archivist_ynh on a local external disk
  • with archivist_ynh on the same disk
  • with a custom method using hooks
  • with a custom method without using hooks but using yunohost backup create
  • with a custom method without using yunohost backup create at all
  • others ways

0 voters

I’m currently finishing up support for borg, remote repositories, and scheduling backups.

Your answers will help me to not forget some use cases and to know a little bit more about the current practices.

8 Likes

I am currently using Archivist with some custom scripts to backup my VPS:

  1. for local backups (only, since its config panel is broken at the moment)
  2. then cronjobs:
    1. with rclone to send them on Scaleway encrypted object storage Glacier bucket, taking advantage of their 75GB free tier. Edit 2024-01-14: storage is not free anymore.
    2. then copying them over SSHFS to my in-home NAS and deleting the local archives since my VPS storage space is limited
# m h  dom mon dow   command
0 1 * * * rclone copy local:/home/yunohost.app/archivist/backup scaleway_crypt:/
0 4 * * * rsync -a --remove-source-files /home/yunohost.app/archivist/ /media/nas/vps/archivist/

I’m by no means an example, and would love a more integrated solution. :slight_smile:

2 Likes

Right now I have a custom systemd unit that backs up my server to B2 using restic

1 Like

I use hooks/scripts based on your tuto with Borg before your app is available. I play with setgid and ACL to add the nextcloud group automatically to the backups to enable synchronisation with Nextcloud. It can be a good option for borg_ynh and yunohost users that only have backup on the same disk, what do you think about it? The user must only add a local external storage on nextcloud.
The backups are on another disk (I use symbolic links) and on my laptop with synchronisation of nextcloud.
I separate the mail backup, system backup and apps backup with 3 scripts/hooks using Borg with a different frequency.
In addition, i use proxmox backup one a week and snapshot before each upgrade.
I’ve been planning for a long time to add an external backup on another server or on a cloud/service like borgbase.
Perharps it’s too much but i never lost important files.

1 Like

Thanks for working and publishing on this topic, curious to see the results and learn from the community!
Quick remark for the poll (answer #1) : I backup and I use snapshots (since I have some proxmox’ed instances of ynh. So I checked the case anyway.

Good backups everyone :smile_cat:

2 Likes

Indeed it’s an error in my poll, i miss an option.

borg app stopped working for me a week ago, and snapshots are not available after moving VPS from previous hosting
so I’m thinking about to try restic, what other ways am I left with?
=(

2 Likes

I have a symlink of the yunohost.backup directory in the ZFS pool, and I create backups using the standard YunoHost utility. I used to send backups to a VPS using a scp script, but that was a very impractical solution. Experimented with other solutions, but they were not transparent enough.

1 Like

For people using symlink on /home/yunohost.backup (not /home/yunohost.backup/archives) have you already tried to restore something (is it working ?)?

@ metyun @ArtemS

1 Like

Every week-end (when I can) I use the yunohost backup then I download the tar archive on my external disk.
I make a backup for my applications (not all) and one for the system. I use a home-made script to run it with one command.

And then I have my tar archive at home, I run updates :stuck_out_tongue:

2 Likes

Yes, it works. I’ve restored several applications, all successfully.

1 Like

Je loue deux serveurs (deux KS-3 de chez Kimsufi). Le premier serveur se backupe sur le deuxième et vis-versa avec borg-ynh.

Tous mes documents impostants sont sur nextcloud donc j’utilise également la synchronisation nextcloud (sur plusieurs ordinateurs!) + backup en local sur un disque externe.

1 Like

@Artanux as-tu vérifié que les 2 serveurs sont dans des bâtiments (voir des villes différentes) ?

Non. Et j’y pense souvent… Ce n’est clairement pas l’idéal.

Ça m’arrive de télécharger manuellement une ou l’autre archive (wiki, par ex.).

Mais comme je l’ai dis, les trucs vraiment importants sont sur mon nextcloud pour lequel j’ai synchro + backups locaux.

1 Like

I use symlink only for borg backup and /home/yunohost.backup/archives and not for /home/yunohost.backup.
When i only use the yunohost backup system, i remember i can’t backup or i have some errors with symlink on /home/yunohost.backup, that’s why i have symlink on /home/yunohost.backup/archives. But that was a long time ago…

1 Like

I use yunohost backup create method but inside my bash script (GitHub - cichy1173/yh-backup: Personal bash script for backuping yunohost to external drive) to second drive.
I added the script to Cron and I backup my Yunohost apps three times a week.

1 Like

I have on local backup and one remote encrypted and incremental.
My backups are configured that way :

I use crontab / yunohost backup / restic / S3 storage at scaleway / two shell scripts

crontab each day start at midnight yunohost backup create
crontab each day start at 2am launch my first script restic backup
crontab each sunday of the week at 4am launch my second script restic backup

the first script is :

  • I load restic param

source /home/admin/.restic-backup

  • I rotate the local backup to keep only the last 4days

find /home/yunohost.backup/archives/* -mtime +4 -delete

  • I synchronize with restic the backup folder to my remote backup.

restic --password-file /root/.restic -r "s3:https://my.super.cloud.s3.storage.com/ououlala" backup /home/yunohost.backup/archives --tag yunohost

my second script is :

  • I load restic param

source /home/admin/.restic-backup

  • I check consistency of my remote backup

restic --password-file /root/.restic -r s3:https://my.super.cloud.s3.storage.com/ououlala check

  • I rotate my remote backup to keep the last 30 days and delete the rest

restic --password-file /root/.restic -r s3:https://my.super.cloud.s3.storage.com/ououlala --verbose --tag yunohost forget --keep-last 30 --prune

I don’t think this is an ideal solution. I haven’t tested it (I know it is very bad :neutral_face:)

My ideal solution would be to have in yunohost core a configuration panel to setup encrypted and incremental remote backup (SFTP or S3).
Eventually we could configure both local and remote backup via this tool with all necessary parameter.
What would be awesome is to have also option to setup semi-auto backup via usb.
Like you plug your usb storage set it up as backup in yunohost and then next you plug it in it does automagically the backup with all encrypted incremental etc…

(edit) I forgot to mention another awesome functionnality, since we speak encrypted backups there is the primordial question of storage of the encryption keys, if we could use secure elements type of physical storage such as nitrokeys will be super best.

2 Likes