dnfvsync is a command-line utility written in Python for downloading and syncing your DNFileVault purchases and groups to a local folder. It is designed to be run periodically on a server to keep a local archive up to date but can also be used for single-account sync runs.
- Downloads purchases and groups to a local archive
- Optional group filtering and sync window (
DNFV_DAYS) - Resume support for partial downloads via HTTP Range when available
- Progress bars and configurable logging
- Retries with backoff
-
Install Python 3.10+: Make sure Python 3.10 or newer is installed.
-
Clone the repository:
git clone https://github.com/kevinrider/dnfvsync.git cd dnfvsync(If you prefer SSH, use
git clone git@github.com:kevinrider/dnfvsync.git.) -
Install dependencies:
python3 -m venv .venv && . .venv/bin/activate && python3 -m pip install -e .
(On some Linux distros you may need
python3-venvinstalled for the venv step.)(Use
pip install .if you do not need editable mode.)
Configuration can be loaded from a config file and/or environment variables. CLI arguments override config and environment variables; environment variables take precedence over the config file.
dnfvsync will read the config file path from --config if provided, otherwise it will read the first config file it finds in this order:
~/.config/dnfvsync/config.ini~/.dnfvsync.ini
Example config file:
[dnfvsync]
email = you@example.com
password = your-password
out_dir = /data/dnfilevault-downloads
groups = eodLevel2,eodLevel3
days = 7
log_level = INFO
log_file = /var/log/dnfvsync.log
max_retries = 5
backoff_seconds = 1.0| Variable | Description | Example |
|---|---|---|
DNFV_EMAIL |
DNFileVault account email. | you@example.com |
DNFV_PASSWORD |
DNFileVault account password. | your-password |
| Variable | Description | Default |
|---|---|---|
DNFV_BASE_URL |
API base URL. | https://api.dnfilevault.com |
DNFV_OUT_DIR |
Output directory for downloads. | ~/dnfilevault-downloads |
DNFV_GROUPS |
Comma-separated group names to include. | (all groups) |
DNFV_DAYS |
Sync window in days. | 7 |
DNFV_LOG_LEVEL |
Log level. | INFO |
DNFV_MAX_RETRIES |
Retry attempts for retryable HTTP errors. | 5 |
DNFV_BACKOFF_SECONDS |
Base backoff seconds (exponential with jitter). | 1.0 |
Copy the following into .bashrc, updating as needed for your specific config:
export DNFV_EMAIL='you@example.com'
export DNFV_PASSWORD='your-password'
export DNFV_OUT_DIR="$HOME/dnfilevault-downloads"
export DNFV_GROUPS="eodLevel2,eodLevel3"
export DNFV_DAYS="7"Apply changes:
source ~/.bashrcRun from the command line:
dnfvsyncDisable progress bars:
dnfvsync --no-progressLogging options:
dnfvsync --log-level DEBUG --log-file dnfvsync.logModule entry point:
python3 -m dnfvsyncFor automatic, periodic sync, schedule the script to run using cron. A reasonable cadence is once per day.
Example Cron Job:
-
Open your crontab for editing:
crontab -e
-
Add the following line, replacing
/path/to/dnfvsyncand the Python path as needed (runs daily at 6:00 PM):0 18 * * * cd /path/to/dnfvsync && /path/to/python -m dnfvsync >> /your/log/dir/dnfvsync.log 2>&1
-
An alternative is to check at regular intervals (every 12 hours in this example):
0 */12 * * * cd /path/to/dnfvsync && /path/to/python -m dnfvsync >> /your/log/dir/dnfvsync.log 2>&1
Install dev dependencies and run pytest:
python3 -m pip install -e ".[dev]"
python3 -m pytest