Incremental Backup System Using BORG backup as Backend

I want to share with you a collection of bash scripts that I made to perform incremental backups of Vesta Control Panel users and server config, using Borg Backup as backend. Maybe you can analize the possibility to add this to the Hestia panel.

The problem
Vesta CP provides by default a backup system, this backup system creates a tar for each user every day (by default 10 copies are saved), But this way of making backups has some disadvantages when you have a lot of users:

  • Server overload. Earch time the backup is run, a complete copy of user files are saved.
  • Disk space consumption. Each backup copy contains a full backup of the user files. So its very easy to run out of disk space.

The solution
An incremental backup is one in which successive copies of the data contain only the portion that has changed since the preceding backup copy was made. This way you can store lot of backups points, without making a full backup each time.

Borg Backup does an excellent job making incremental backups. And provide very interesting features such as compression, encryption and good performance. You can get more info at https://www.borgbackup.org/

How the script collection works
The main backup script is designed to be run every day via cronjob. This script saves a snapshot of all users, server config and vesta directory into different Borg repositories.

This borg repositories are saved in /backup by default, organized in folders.

Then, different scripts are provided to automatically restore users, webs, mail domains or databases if needed.

Additionally, it is possible to archive users who are no longer active (they are saved into an offline archive directory), and in these users the incremental backups do not run. In this way we also save disk space.

Full explination, install instructions and documentation is available here:

Its my first git project, please let me know what you think about it.