blob: 14c0f589c9f048e9b853cb2faeb574428d500eb2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
# xbackup
This is a convenience wrapper around the Borg backup tool.
## Expected Environment
This tool is designed for Arch Linux. Because it is written in Python and has
minimal dependencies it should be easy to adapt it to other Linux distributions.
These dependencies have to be installed:
- [python3](https://www.python.org/)
- [borg](https://www.borgbackup.org/)
## Installation
Please select the right subsection for your system.
### Arch Linux
Visit my [packaging repository ](https://gitea.xengineering.eu/xengineering/pkgbuilds/src/branch/master/xbackup)
to get the build files. You can then install the software like an AUR package
following the [recommendations](https://wiki.archlinux.org/title/Arch_User_Repository#Installing_and_upgrading_packages)
in the Arch Linux wiki.
### Other Linux Distributions
The Makefile of this repository will help you to install the software or create
a tar archive of a certain commit (which could be helpful for packaging).
Keep in mind, that there is no maintained way to uninstall the software via the
Makefile! The reason for that is an additional amount of work, the possibility
of bugs in the uninstall routine and the existence of package managers for Linux
which guarantee you correct uninstallation.
The Makefile of this repository contains an `install` target. Simply run
```
sudo make install
```
to install it to your system. Alternatively you can install it to a fake root
folder:
```
make DESTDIR="path/to/my/fakeroot" install
```
or create only a tar archive from this source for external packaging:
```
make tarball
```
## Usage
This section covers the main use cases addressed by xbackup.
### Configuration
Please edit the configuration file at `/etc/xbackup/config.json` before you run
the software. It contains suitable defaults for a full system backup which is
the main purpose of this script.
Using the default configuration, xbackup will include everything from the root
folder `/` blacklisting only folders which are not reasonable for a backup,
because they are virtual filesystems from the Linux kernel (like `/dev`), only
contain temporary data (like `/tmp`) or are not part of the system itself (like
`/mnt` or `/media`).
### Make a Backup
After configuration you can run the backup like this:
```
sudo xbackup backup
```
For further details run `xbackup --help`. There are options to select a
different configuration file and for a non-interactive execution which is
suitable for scripting.
### Prune your Backups
Just making backups leads to increased disk space usage. To avoid a harddrive
full of backups the Borg backup tool allows you to prune your backups. This
functionality is also wrapped by xbackup.
Edit the configuration file to select how many backups you want to keep. Then
run:
```
sudo xbackup prune
```
This will clean up the backup repository in the location specified by your
configuration file.
## Done / Features
(Last finished task first)
- [x] implement prune command
- [x] move Arch Linux packaging to pkgbuilds repository
- [x] manual backup functionality / MVP
- [x] config parsing
- [x] argument parsing
- [x] implement Arch Linux Packaging
- [x] setup project structure
## To do / Feature Requests
(Highest priority first)
- [ ] release v1.0.0
- [ ] MariaDB fullbackup
- [ ] backup daemon
- [ ] backup transfer tool (?)
- [ ] backup diff tool (backup vs. filesystem)
- [ ] backup restore tool with qemu (for testing)
|