Barkup is a Python-based CLI tool for automating personal backups to local and cloud storage with support for Google Drive.
Project description
Barkup
Barkup is a Python-based CLI tool for automating personal backups to local and cloud storage (Google Drive), with incremental, hash-checked copies and a config-driven workflow.
Motivation
Barkup started because I needed a reliable way to automatically back up the photos from my final year at university — and the ones I'll keep taking at conferences and elsewhere — to somewhere safe like Google Drive. I soon realized the same approach covers my eBooks and other files too. Barkup is the result: a small, config-driven CLI I built for myself, and my first personal project on boot.dev.
Quick Start
# Clone and install
git clone https://github.com/abu-bilaall/barkup
cd barkup
uv sync
# Scaffold a config, then edit it
uv run barkup init
# writes ~/.config/barkup/config.toml (see config.example.toml for all options)
# Run your first backup
uv run barkup run
# List what's backed up
uv run barkup list
Once installed, the barkup command is available via uv run barkup. You can also install the console script directly (uv pip install -e .), or install from PyPI once published (pip install barkup).
Usage
Configuration
Barkup loads and deep-merges config from these locations, lowest to highest priority:
/etc/barkup/config.toml(system)~/.config/barkup/config.toml(user; respectsXDG_CONFIG_HOME)./barkup.config.toml(current directory)--config <PATH>(CLI flag — highest priority)
A minimal config:
[general]
profile_name = "default"
dry_run = false
sources = ["/home/you/Documents", "/home/you/Pictures"]
compression = false
exclude = ["*.tmp", ".git", "node_modules"]
[local]
destination = "/mnt/backups"
exclude = [".tmp*"]
[[cloud_providers]]
provider = "google_drive"
enabled = false
# credentials_file = "/home/you/.barkup/google_drive.json"
# remote_folder = "Backups/Barkup"
[general]sets defaults forsources,compression, andexclude.[local]and[[cloud_providers]]override those defaults; theirexcludelists merge and deduplicate with the general list.compressionis a placeholder for the upcoming ZIP feature.- See
config.example.tomlin the repo for the full annotated example (including[advanced] temp_dir).
Commands
Global option: --config <PATH> (use a custom config file for any command).
| Command | Options | Description |
|---|---|---|
barkup init |
--force |
Create the default config at the user config path (overwrite with --force). |
barkup run |
--name <PROFILE>, --yes |
Run a backup. --name selects the profile; --yes skips the confirmation prompt (for automation/cron). |
barkup list |
--name <PROFILE> |
List backed-up files (original path, backup path, size, last backup). Filter by profile. |
barkup status |
--name <PROFILE> |
Show backup statistics for a profile (or all profiles). |
barkup verify |
--name <PROFILE> |
Recalculate hashes and compare with stored state; reports OK / missing / mismatched. Exits non-zero if any problem is found. |
barkup restore <path> |
--to <DEST>, --all, --name <PROFILE> |
Restore a single file (or --all for the whole set). --to restores to a custom location (preserves directory structure); --name selects the profile. --all requires --name. |
Examples:
uv run barkup run --name default --yes
uv run barkup restore /mnt/backups/Documents/notes.txt --to ~/restore
uv run barkup restore --all --name default --to ~/restore-all
uv run barkup verify
How I use Barkup
I run Barkup unattended as a scheduled job (cron) rather than by hand. My setup:
barkup initto scaffold~/.config/barkup/config.toml.- Point
[general].sourcesat~/Picturesand~/Documents; set[local].destinationto an external drive; enable thegoogle_driveprovider with a credentials file and aremote_folder. - Run it daily via cron with
barkup run --yes— the--yesflag skips the confirmation prompt so it runs non-interactively.
The config is the single source of truth, so adjust sources, destinations, and schedule to taste.
Contributing
-
Requires Python 3.12+ and
uv. -
Install dev dependencies and run tests:
uv sync uv run pytest -v
-
Lint/format:
uv run ruff check .anduv run black --check .. -
Run the app during development:
./main.shoruv run src/main.py. -
Workflow: feature branches are opened against
dev; PR titles follow[Feature NN] - <summary>(see.github/PULL_REQUEST_TEMPLATE.md). Keep changes focused and tests deterministic.
License
Released under the MIT License.
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 barkup-0.1.0.tar.gz.
File metadata
- Download URL: barkup-0.1.0.tar.gz
- Upload date:
- Size: 80.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4d2cbe9558ffe2f3a00cdeca033754f81c4af8d1fb3a50356058b46f00a7b0f
|
|
| MD5 |
046920ea7d9b0b12e1d246687b55f94c
|
|
| BLAKE2b-256 |
f3c2db0e8ba7893cc9d6362f29fd2dd09cf6bc2a7750ccd46c84fc2d573b9f9e
|
Provenance
The following attestation bundles were made for barkup-0.1.0.tar.gz:
Publisher:
release.yml on abu-bilaall/barkup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
barkup-0.1.0.tar.gz -
Subject digest:
e4d2cbe9558ffe2f3a00cdeca033754f81c4af8d1fb3a50356058b46f00a7b0f - Sigstore transparency entry: 2204674905
- Sigstore integration time:
-
Permalink:
abu-bilaall/barkup@921ff43932f128fb55e3e9680510d3d913168319 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/abu-bilaall
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@921ff43932f128fb55e3e9680510d3d913168319 -
Trigger Event:
push
-
Statement type:
File details
Details for the file barkup-0.1.0-py3-none-any.whl.
File metadata
- Download URL: barkup-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0219979801070cc1dea73ccbdfed744ab6743beeb3ab2b5a4f5cb46637d99142
|
|
| MD5 |
6c0e8c26c1851da5e62924a634cf7bac
|
|
| BLAKE2b-256 |
adf2ef35b54606cdccee6d89a7bfd0c6c59c4f0f0387d299008d33a3429fa306
|
Provenance
The following attestation bundles were made for barkup-0.1.0-py3-none-any.whl:
Publisher:
release.yml on abu-bilaall/barkup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
barkup-0.1.0-py3-none-any.whl -
Subject digest:
0219979801070cc1dea73ccbdfed744ab6743beeb3ab2b5a4f5cb46637d99142 - Sigstore transparency entry: 2204674913
- Sigstore integration time:
-
Permalink:
abu-bilaall/barkup@921ff43932f128fb55e3e9680510d3d913168319 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/abu-bilaall
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@921ff43932f128fb55e3e9680510d3d913168319 -
Trigger Event:
push
-
Statement type: