My backup system in a bit more detail

Restic is a fast, secure, open-source backup tool that creates encrypted, deduplicated snapshots of your data and stores them in local or remote repositories. It is designed to be simple to use, efficient with storage, and reliable for both backups and restores.

Introduction

Who backs up...? I back up, that’s who... although it is something I didn’t do for a long time. Since I started self-hosting and gathering my own data, I thought that it was about time that I did the responsible thing and do a regular backup. As Yunohosters, we are lucky in that the platform comes with an, albeit simple, backup solution via the admin panel.

Screenshot 2026-08-25 at 8.35.35 am.png

As a backup solution, it’s very good as it packages everything needed for an app or a user and their email into a nice little tarball, so when you have to restore something, it puts everything back in the right place. Very neat and tidy.

This is a manual process, but you can automate it with a simple cron job, which is what I did.

In the terminal on your server, type: crontab -u root -e. You need to be root to do this, so just do an su and type in your password again before running crontab -u root -e. You can then edit the crontab file. Here is mine: (for better or for worse, but it works).

#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#        CRONJOB TO BACKUP THE YUNOHOST SERVER USING THE 
#                              YUNOHOST BACKUP SERVICE.
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# See the lables on the external drives: "YUNOHOST" is the Yunohost
# backup drive, a good old fashioned 'spinner'.
#
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# 1. Backing up the full system to /dev/sdb1 (/media/yunohost/) simlink'ed
# There is a blank .nobackup file in the yunohost.multimedia directory,
# this is to prevent this directorybeing backed up. ALL multimedia files
# are backed up using Restic and Backrest to a 2nd drive called
# "DATARECOVERY"
#
0 0 * * 3,7 yunohost backup create
#
# Full back up will start at MIDNIGHT every WEDNESDAY and SUNDAY.
#
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#
# 1.1 Other items to back up at other times will be email
#
0 6 * * * yunohost backup create --system data_mail
#
# Email is backed up EVERYDAY at 4 AM
#
# 1.2 More items to be bnacked up include all the system users home folder.
#
0 7 * * * yunohost backup create --system data_home
#
# User home folders backed up every day at 5am
#
#++++++++++++++++++++++ WE ARE DONE HERE...+++++++++++++++++++++++++++++++

I’ve made the commands bold here for clarity, but as you can see, it’s very simple. And on the Yunohost website and forum, you can find all the different types of commands to use with yunohost backup create

Im sure that there will be some puritans out there that say that there is something wrong with this. It has worked flawlessly for me for a long time now, but if there is something wrong with it, then I would like to know. I created a symbolic link to the external drives, which is where the backup tarballs that Yunohost creates are stored. Why? Well, disk space mainly, but also it gets the backup OFF the servers dirive and somewhere safe if the server fails.

So this is my very basic backup setup. Great. I have had to use it on occasion when updated applications don’t work. Each time you do an application update, the original is backed up, so you can restore it if the update fails. Very handy.

However, this method is not quite following the 3-2-1 rule. 

The rule breaks down as follows:

According to this rule, I am doing some of this. The above is the gold standard for backup; however, when resources and money dictate, then you have to make do with whatever you can. Any backup is better than no backup, right?

What do I backup and where?

I back up everything. I have a lot of time and memories invested in the data that I have curated over the years, and I have been bitten badly once, and lost a massive amount of data. Now I’m self-hosting I want to make sure that everything is backed up somehow, somewhere. I use the Yunohost backup with a cron job for automatic back up to a USB drive and and Restic for a more granular, selective backup. I'll do a section later just on Restic and how I have set it up.

So I have the following in place:

How to...

Descriptions of connecting to USB drive via sftp

Descriptions od connecting to iDrive S3

Thoughts

Well?