An rsync wrapper (or output parser) that pushes metrics to prometheus.
This allows you to then build dashboards and alerting for your rsync batch jobs.
go install github.com/stapelberg/rsyncprom/cmd/rsync-prom@latest
9 9 * * * /home/michael/go/bin/rsync-prom --instance="sync-drive" -- /home/michael/sync-drive.sh
[Service]
ExecStart=/home/michael/go/bin/rsync-prom --instance="sync-wiki" -- /usr/bin/rsync --exclude data/cache -av --checksum server:wiki/ /var/cache/wiki
Here’s an example for code which uses the x/crypto/ssh
package to trigger
rsync on a remote machine and parses the output: