yarb
Yet another Redis backup utility. Partial port of upstash-redis-dump to Python 3.10+.
Dump
pip install -r requirements.txt
export REDIS_URL="rediss://:password1@redis-host.com:12345"
python yarb.py $REDIS_URL my-dump.resp
python yarb.py --help # for options
Load
From manual:
cat my-dump.resp | redis-cli --pipe
Periodic backup
export REDIS_URL="rediss://:password1@redis-host.com:12345"
python yarb_periodic.py
python yarb_periodic.py --help # for options
Run as systemd service
See full manual. Example setup:
- Create
systemdservice
sudo nano /etc/systemd/system/yarb.service
Paste something like:
[Unit]
Description=Redis periodic backup
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=my-username
ExecStart=/full/path/to/venv/bin/python /path/to/yarb_periodic.py --workers 10 --backups-dir /path/to/backups/dir
[Install]
WantedBy=multi-user.target
- Create
.confconfiguration to pass environment variable with Redis URL
sudo systemctl edit yarb.service
Paste something like
[Service]
Environment="REDIS_URL=rediss://username:password@redis-host.com:6379"
- Start the service and check everything is working
sudo systemctl start yarb.service
# check status
sudo systemctl status yarb.service
# to view live logs
journalctl -u yarb.service -f
- Enable service so that it is restarted on reboot
sudo systemctl enable yarb.service
Aux scripts
After dumping remote Redis, you can load the dump into local instance and compare it with prod. This script will go through local keys and check corresponding remote values, printing any changes.
REDIS_URL=my-prod-redis:12345 python diff_redis_with_local.py
yarb_periodic.py stores metadata for each backup in a JSON file. To visualize some trends
in this metadata, use visualize_metadata.py.
Metadata
Release files for yarb-against-war 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| yarb_against_war-1.0.2.tar.gz | 4.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yarb_against_war-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / yarb_against_war-1.0.2.tar.gz
| Download URL | yarb_against_war-1.0.2.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e18cb0b19854775a21ae105de6e9d8b819ef1480261354726239ac2c342970a4
|
|
BLAKE2b-256 checksum How to use checksums |
5ffe05a9cc310d15946d7ae18365d34f1c57647670e6b9b9899a15d129c7b0cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.14
|
Release files / yarb_against_war-1.0.2-py3-none-any.whl
| Download URL | yarb_against_war-1.0.2-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f7b49495562b159c832f335ff9f00567c9fdded5f937eb3298941d9fcf08827
|
|
BLAKE2b-256 checksum How to use checksums |
d5cf1fab08ee87e9ed0353b2910448f0c82641b5a57011844933b5b96598da8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.10.14
|
Security for yarb-against-war 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.