Files
simple_backup/README.md

72 lines
2.2 KiB
Markdown
Raw Normal View History

2023-05-05 19:03:23 +02:00
simple_backup
============
2015-12-08 11:32:45 +01:00
A simple backup script
## Description
2023-04-15 19:49:33 +02:00
simple_backup is a Python script that allows you to backup your files.
2023-05-05 19:23:21 +02:00
Parameters like input files/directories, output directory etc. can be specified in a configuration file, or on the command line.
Run:
2023-05-05 19:03:23 +02:00
```bash
simple_backup -h
```
to print all possible command line options.
2015-12-08 11:32:45 +01:00
## Dependencies
2023-05-05 19:03:23 +02:00
The script uses rsync to actually run the backup, so you will have to install it on your system. For example on Arch Linux:
```bash
sudo pacman -Syu rsync
```
It's also required to have python-dotenv
Optional dependencies are systemd-python to enable using systemd journal for logging, and dbus-python for desktop notifications.
2023-05-05 19:03:23 +02:00
## Install
To install the program, first clone the repository:
```bash
git clone https://github.com/Fuxino/simple_backup.git
```
Then install the tools required to build the package:
2023-05-05 19:30:53 +02:00
```bash
pip install --upgrade build wheel
2023-05-05 19:30:53 +02:00
```
Finally, run:
2023-05-05 19:03:23 +02:00
```bash
cd simple_backup
python -m build --wheel
python -m pip install dist/*.whl
2023-05-05 19:30:53 +02:00
```
2023-05-05 19:03:23 +02:00
For Arch Linux and Arch-based distros, two packages are available in the AUR (aur.archlinux.org):
- **simple_backup** for the release version
- **simple_backup-git** for the git version
2023-05-05 19:03:23 +02:00
2023-05-29 21:56:58 +02:00
## Remote backup
> **Warning**
> This feature is experimental
It's possible to use a remote server as destination for the backup. Just use the --username (or -u) and --host arguments (or set them in the configuration file).
2023-05-29 21:56:58 +02:00
For this to work, rsync must be installed on the server too.
### Server authentication
2023-06-02 00:09:14 +02:00
The best way to handle the authentication is to have an ssh agent running on your system, otherwise if a passphrase is necessary to unlock the ssh key, it will be necessary to enter it more than once.
2023-05-31 22:12:59 +02:00
If needed, it's possible to specify the ssh key location with the --keyfile argument or in the configuration file.
2023-05-31 22:12:59 +02:00
To be able to connect to the user's ssh agent when running simple_backup with sudo, make sure to preserve the SSH_AUTH_SOCK environment variable. For example:
```bash
sudo --preserve-env=SSH_AUTH_SOCK -s simple_backup [options]
```
2023-05-31 22:12:59 +02:00
or by editing the sudoers file.
2023-06-02 00:09:14 +02:00
If SSH key authentication is not available, password authentication will be used instead.
Check the man page for more details.