How do you backup your YunoHost server?

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

I used to do this, years ago, but there were a problem with /home/yunohost.backup/tmp folder and I was not able to make more than 1 backup and had to manually empty this folder each time.
So now I have a link on /home/yunohost.backup/archives

1 Like

Very important topic!

I’m very impressed by all the creative solutions that you are using. Right now I’m doing a mix of things. I use snapshots made by the VPS provider, I sync all my files with NextCloud client and sometimes I backup manually YNH from the backup panel.

As @Guwom said, it would be awesome to have a backup solution integrated and easy to use.

Another very cool thing would be to have a sort of automatic exchange of backup space between users. I know this could be done manually now, but imagine how cool would be.

1 Like

i don’t care about backing up the server, the only important part is the data.

  • nextcloud syncs my day to day working files between server and all my laptops
  • i use restic with a cron job to make snapshots of important data everyday to local RAID1
  • use restic with cron job to make duplicate snapshots to rest-server with remote RAID1 over wireguard

i think the restic_ynh complicates restic too much, also SFTP is slow. should use rest-server GitHub - restic/rest-server: Rest Server is a high performance HTTP server that implements restic's REST backend API.

1 Like

My custom method is to have an openvpn tunnel between my server and a rasbperry pi at my home connected to a large HDD. There’s a script that runs every night that creates a backup with yunohost backup create and pushes it to the rpi via Restic

1 Like