Butterfly-Backup

Butterfly Backup is a simple command line wrapper of rsync for complex task, written in python.

View the Project on GitHub MatteoGuadrini/Butterfly-Backup

Butterfly Backup Butterfly Backup

Codacy Badge CircleCI

Introduction

Butterfly Backup is a modern backup program that can back up your files:

Test

If you want to try or test Butterfly Backup before installing it, run the test:

$ git clone https://github.com/MatteoGuadrini/Butterfly-Backup.git
$ cd Butterfly-Backup
$ bash test_bb.py
...
[92512a6e-506e-11eb-b747-2ba55b805ea5]
type = full
path = /tmp/bb_repo/localhost/2024_01_06__23_28
name = localhost
os = unix
timestamp = 2024-01-06 23:28:59
start = 2024-01-06 23:28:59
end = 2024-01-06 23:29:04
status = 0

Installation

Install Butterfly Backup is very simple; run this:

git clone https://github.com/MatteoGuadrini/Butterfly-Backup.git
cd Butterfly-Backup
sudo python3 setup.py install -f # -f is for upgrade
# or
sudo pip install . --upgrade
bb --help

Quickstart

A short demo of Butterfly Backup:

bb backup --computer host1 --destination /nas/mybackup --data user config --type macos --mode full

or with short option:

bb backup -c host1 -d /nas/mybackup -D user config -t macos -m full

So we created a first full backup, on a macos machine, considering the folders User -> /Users and Config -> /private/etc in the destination /nas/mybackup

[!NOTE]
If you do not specify the user, Butterfly Backup will assume that the source and the destination know the same user; for example, I start the backup with the above command and my user is calling arthur, he will use the latter to log in to host1.

Now that we have our first full backup, we can run incremental for the next few times.

bb backup --computer host1 --destination /nas/mybackup --data user config --type macos

or with short option:

bb backup -c host1 -d /nas/mybackup -D user config -t macos

[!NOTE]
Incremental mode performs a full backup when they have not been done before.

Before starting any restore, you need to understand what kind of data and in what time period you have to start. So, let’s start checking our backups into the catalog, with this command:

bb list --catalog /nas/mybackup

The result will be the following:

BUTTERFLY BACKUP CATALOG

Backup id: f65e5afe-9734-11e8-b0bb-005056a664e0
Hostname or ip: host1
Timestamp: 2024-08-03 17:50:36

Backup id: 4f2b5f6e-9939-11e8-9ab6-005056a664e0
Hostname or ip: host1
Timestamp: 2024-08-06 07:26:46

Backup id: cc6e2744-9944-11e8-b82a-005056a664e0
Hostname or ip: host1
Timestamp: 2024-08-06 08:49:00

Select (copy) Backup id when you want restore a backup. For exit, press q.

Now, run this command for more detail (for example, try the first):

bb list --catalog /nas/mybackup --backup-id f65e5afe-9734-11e8-b0bb-005056a664e0

The result will be the following:

Backup id: f65e5afe-9734-11e8-b0bb-005056a664e0
Hostname or ip: host1
Type: full
Timestamp: 2024-08-03 17:50:36
Start: 2024-08-03 17:50:36
Finish: 2024-08-03 18:02:32
OS: macos
ExitCode: 0
Path: /nas/mybackup/host1/2024_08_03__17_50
List: etc
Users

Now that we are sure that the selected backup is what we want (both in data and on date), run this command:

bb restore --computer host1 --catalog /nas/mybackup --backup-id f65e5afe-9734-11e8-b0bb-005056a664e0

So we have restored the data saved on the date indicated in our host1.

Documentation

Manual of Butterfly Backup or run help:

bb --help

Open source

Butterfly Backup is a open source project. Any contribute, It’s welcome.

A great thanks.

For donations, press this

For me

paypal

For Telethon

The Telethon Foundation is a non-profit organization recognized by the Ministry of University and Scientific and Technological Research. They were born in 1990 to respond to the appeal of patients suffering from rare diseases. Come today, we are organized to dare to listen to them and answers, every day of the year.

Adopt the future

Acknowledgments

Thanks to Mark Lutz for writing the Learning Python and Programming Python books that make up my python foundation.

Thanks to Kenneth Reitz and Tanya Schlusser for writing the The Hitchhiker’s Guide to Python books.

Thanks to Dane Hillard for writing the Practices of the Python Pro books.

Special thanks go to my wife, who understood the hours of absence for this development. Thanks to my children, for the daily inspiration they give me and to make me realize, that life must be simple.

Thanks Python!