Fetch'n'Backup - Simple two-step backup tool with rsync
Project description
fnb — Fetch'n'Backup
fnb is a simple two-step backup tool, powered by rsync.
It gives you two handy commands:
fetch (to pull from remote), and
backup (to save to somewhere safe).
Under the hood? Just good old rsync — no magic, just sharp automation.
- Simple config. Sharp execution. Safe data.
- Use them one by one, or
syncthem all in one go.
🚀 Features
- Fetch — Retrieve data from a remote server to your local machine
- Backup — Save local data to external storage
- Sync — Run Fetch and Backup together in one go
- Init — Generate an initial config file (
fnb.toml) - Structured Logging — Built-in logging with configurable verbosity levels and file output
⚙️ Installation
From PyPI (Recommended)
pip install fnb
# または
uv pip install fnb
From Source
git clone https://gitlab.com/qumasan/fnb.git
cd fnb
uv sync --all-groups
uv run fnb --help
Requirements: Python 3.12 or higher is required.
See the full Installation Guide for more options, including running from source without installing.
🧰 Quick Start
# Initialize configuration files (fnb.toml and .env files)
fnb init
# Check the current config
fnb status
# Fetch: remote -> local
fnb fetch TARGET_LABEL
# Backup: local -> external
fnb backup TARGET_LABEL
# Run Fetch → Backup in one go
fnb sync TARGET_LABEL
# Check version
fnb version
🔧 Configuration
fnb uses TOML configuration files with sections for fetch and backup operations:
[fetch.SECTION_NAME]
label = "TARGET_LABEL"
summary = "Fetch data from remote server"
host = "user@remote-host"
source = "~/path/to/source/"
target = "./local/backup/path/"
options = ["-auvz", "--delete", '--rsync-path="~/.local/bin/rsync"']
enabled = true
[backup.SECTION_NAME]
label = "TARGET_LABEL"
summary = "Backup data to cloud storage"
host = "none" # Local operation
source = "./local/backup/path/" # Output from fetch
target = "./cloud/backup/path/"
options = ["-auvz", "--delete"]
enabled = true
Configuration File Priority (highest to lowest)
./fnb.toml— Project-local configuration~/.config/fnb/config.toml— Global user configuration (XDG standard)C:\Users\username\AppData\Local\fnb\config.toml— Windows global configuration
📊 Logging
fnb includes built-in structured logging powered by loguru. All CLI commands support --log-level, --verbose (same as --log-level DEBUG), and --quiet (same as --log-level WARNING).
fnb fetch TARGET_LABEL --verbose
fnb backup TARGET_LABEL --quiet
fnb sync TARGET_LABEL --log-level DEBUG
User-facing messages go to stdout; debug/technical logs go to stderr and are also saved to a rotating log file:
- macOS:
~/Library/Logs/fnb/fnb.log - Linux:
~/.local/share/fnb/fnb.log - Windows:
%APPDATA%\qumasan\fnb\Logs\fnb.log
Set FNB_DISABLE_FILE_LOGGING=1 to disable file logging.
🔐 Authentication
SSH password input can be automated using pexpect.
You can also define connection settings (e.g. FNB_PASSWORD_*, FNB_TIMEOUT) in a .env file if needed.
Run fnb init env to create the initial .env file.
🪪 License
MIT
🔗 Links
- 🛠️ Development, Issues, Merge Requests: GitLab — please use GitLab for development contributions, bug reports, and feature requests
- 🌏 Public Mirror and Discussions: GitHub
- 📦 PyPI Package: fnb
- 📖 Documentation: ReadTheDocs — installation, configuration, Contributor Guide, and Maintainer Guide
- 📝 Release Notes: docs/releases/
See CLAUDE.md for detailed development guidelines (testing, linting, release workflow).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fnb-0.16.0.tar.gz.
File metadata
- Download URL: fnb-0.16.0.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6df9bac2912daeecdd0d9759dcd5688e3e6cdc7e2546590a4d9f680792728cf1
|
|
| MD5 |
a13090a152afd00ec11a3dcd42e31100
|
|
| BLAKE2b-256 |
774455e1c396ebff903b3a5954400596509ac4f9fa12b690a99ea949c9db528c
|
File details
Details for the file fnb-0.16.0-py3-none-any.whl.
File metadata
- Download URL: fnb-0.16.0-py3-none-any.whl
- Upload date:
- Size: 38.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8f98d8bb58e4c59daf159f8cabaf35f3a47d77ce1936a3248d5890437914d05
|
|
| MD5 |
9b854f3dae8b0bff93eae5e4b76ae239
|
|
| BLAKE2b-256 |
fdb734ca3d5ec90dc0ccb3973dce32cfbfd04df0a93da478d0adcb1f35603c66
|