Observed since 20 Oct, 19:29 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A Python tool to synchronize AdGuard Home query logs between multiple instances
A Python tool to synchronize AdGuard Home query logs between multiple instances with automatic log rotation.
AdGuardHome-LogSync allows you to merge and synchronize query logs from multiple AdGuard Home instances while automatically managing log retention. This is useful when you're running multiple AdGuard Home instances and want to maintain a unified query log with configurable retention policies.
Install from PyPI:
pipx install adguardhome-logsync
Install from Git repository:
pipx install git+https://github.com/xz-dev/AdGuardHomeLogSync.git
Install from PyPI:
pip install adguardhome-logsync
Install from Git repository:
pip install git+https://github.com/xz-dev/AdGuardHomeLogSync.git
adguardhome-logsync --name <instance-name> --path <querylog-path> --backup <backup-directory> [--retention <seconds>]
--name: Current instance nickname (required)--path: Path to the query log file (required)--backup: Path to backup directory (required)--retention: Log retention time in seconds (optional, default: 604800 = 7 days)adguardhome-logsync --name genx --path ~/adg/workdir/data/querylog.json --backup ~/adg/workdir/data/backup
adguardhome-logsync --name genx --path ~/adg/workdir/data/querylog.json --backup ~/adg/workdir/data/backup --retention 604800
adguardhome-logsync --name genx --path ~/adg/workdir/data/querylog.json --backup ~/adg/workdir/data/backup --retention 43200
adguardhome-logsync --name genx --path ~/adg/workdir/data/querylog.json --backup ~/adg/workdir/data/backup --retention 3600
| Period | Seconds | Example Usage |
|---|---|---|
| 1 hour | 3600 | --retention 3600 |
| 6 hours | 21600 | --retention 21600 |
| 12 hours | 43200 | --retention 43200 |
| 1 day | 86400 | --retention 86400 |
| 3 days | 259200 | --retention 259200 |
| 1 week | 604800 | --retention 604800 (default) |
| 1 month | 2592000 | --retention 2592000 |
Starting log synchronization for instance: genx
Log retention: 604800 seconds (168.0 hours)
Logs older than 2025-01-09 22:41:58 will be removed
Backing up querylog...
Searching for querylog files...
Found 3 querylog files
Merging querylogs...
Writing merged querylog...
Moving to updated querylog at /tmp/tmp2eqv7rdc.json...
Log synchronization completed successfully
Take care! it's from AI (If you have a tested version, please new PR for that, thanks a lot!)
Create a systemd service file /etc/systemd/system/adguard-logsync.service:
[Unit]
Description=AdGuard Home Log Sync
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/adguardhome-logsync --name server1 --path /opt/adguard/querylog.json --backup /opt/adguard/backup --retention 604800
User=adguard
Group=adguard
Create a timer file /etc/systemd/system/adguard-logsync.timer:
[Unit]
Description=Run AdGuard Home Log Sync every 5 minutes
Requires=adguard-logsync.service
[Timer]
OnCalendar=*:0/5
Persistent=true
[Install]
WantedBy=timers.target
Enable and start:
sudo systemctl enable adguard-logsync.timer
sudo systemctl start adguard-logsync.timer
# Run every 5 minutes, keep logs for 1 week
*/5 * * * * /usr/local/bin/adguardhome-logsync --name server1 --path /opt/adguard/querylog.json --backup /opt/adguard/backup --retention 604800
# Run every hour, keep logs for 1 day
0 * * * * /usr/local/bin/adguardhome-logsync --name server1 --path /opt/adguard/querylog.json --backup /opt/adguard/backup --retention 86400
Clone the repository:
git clone https://github.com/xz-dev/AdGuardHomeLogSync.git
cd AdGuardHomeLogSync
Run with uv:
uv run main.py --name genx --path ~/adg/workdir/data/querylog.json --backup ~/adg/workdir/data/backup --retention 604800
AdGuardHomeLogSync/
├── main.py # Main entry point
├── utils/
│ ├── querylog_copy.py # Backup and file operations
│ └── querylog_merge.py # Asynchronous log merging with retention
├── pyproject.toml # Project configuration
└── README.md # This file
BSD-3-Clause
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)Please report issues at: https://github.com/xz-dev/AdGuardHomeLogSync/issues
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.3 | 16 Jun 2025 | 3 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 19:29 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:196e42c37f769f7e6f2fcc775834839f2ff3ece6c871582e612c833d7df7810a