Automatic remote backup system

Discuss

It is still too complicated to setup a backup system for such a valuable resource as Yunohost. What is currently implemented in web UI are absolutely not sufficient, because:

  1. they are manual. No one has resources to do manual backups in proper fashion, and no one should need to
  2. they are local, which is not safe enough.

I am trying to setup a service in systemd with a timer to make backups, and restic + Backrest to copy them to remote locations.
So far not very successfully, due to lack of skills.

All those systems are already available, just lack integration. It would be so nice to have automatic, remote backups available out of the box!

2 Likes

Yes, there are discussions to have this since a long time.

Note that there are borg and restics apps available to setup this, as discussed in Backup methods | Yunohost

4 Likes

I totally understand your frustration – backup has been a pain point for me too for a long time.

However, I think one of the challenges for a true “out of the box” solution is the huge diversity of YunoHost setups. People run it on:

  • Raspberry Pi at home

  • Old repurposed PCs

  • VPS from various providers

  • Proxmox/VMware VMs

  • Dedicated servers

  • …and many other configurations

Each of these has very different constraints in terms of storage, network, performance, and available backup targets. A solution that works great for a VPS (backup to S3-compatible storage) might not be ideal for a Raspberry Pi at home (maybe a simple USB drive or NAS is more appropriate).

Personally, I went through many setups over the years (old PCs, various experiments…) and backup was always a struggle. Now I’m lucky enough to run YunoHost as a VM in a Proxmox cluster at home, with Proxmox Backup Server (PBS) handling daily automatic backups. It’s completely transparent and works great – but it took me a while to get there!

Maybe if you share more details about your current setup (hardware, hosting environment, available storage options for remote backup…), the community could help you find a solution that fits your specific situation?

1 Like

I do not know if anybody can use this, but I run a dedicated server, and have mountet a remote NAS and moved /home/yunohost.backup to it.

sudo -i

cd /home

mv yunohost.backup yunohost.backup.old

ln -s <path_to-NAS>/yunohost.backup yunohost.backup

cat /etc/fstab

/// /<path_to-NAS> cifs vers=3.0,credentials=/root/hostcred,uid=0,gid=4001,dir_mode=0770,file_mode=0770 0 0

Run yunohost backup at 4:30 every day

crontab -l

30 4 * * * /usr/bin/yunohost backup create

However, backing up the NAS is still a maunal process, but it survives a server crash.

Once the NAS has been backed up, I delete files in path_to-NAS/yunohost.backup/archives older than 7 days.

1 Like

in theory, could we write a cron script to mount a remote location as YH backup folder, run YH backup script, mount back the local folder and back things up locally?

It’s important that backups are reliable. I find yunohost backups very reliable, I could move two servers (vps) to two dedicated servers in about an hour or less.

I have mounted /home/yunohost.backup/archives to an NFS storage.

Restoring backups should be flawless.

So it depends on what backup strategy you want. A cron job would do it.

But you may share with us :

  • What backup storage do you have or plan to use?
  • What is the size of data that will be backed up?
  • It’s recommended to have 3 backups in 2 different locations :sweat_smile:, I personally don’t do it, because I didn’t really plan a full backup strategy. What are you doing now?
1 Like

One major problem with backup is the storage. It might look as wasted storage when used and it is often an economy choice to not do it. The more you store, the more you have to backup. self-hosted systems have this interest due to the fact you can buy the storage and not rent it. But having big volumes of data make backups more expensive.

A dream : a community shared backup strategy. What i mean is : every user of yunohost dedicate a space for distributed backup that is used by other; your last backup is in the community hands but ciphered so usable only by you.
Or could some distributed public files like IPFS solution help on that ?

One current limited way to implement it is using borg client / borg server app and work with pairs.
Just being able to pick a pair ; to find somebody agreeing to host your backup,.
This of course leaves out the latency of restoration, that really sparks when volumes of data expands.

1 Like

There is a kind of stuff similar to this : Tahoe-LAFS

It’s a distributed file system that store your data, in multiple containers.

1 Like