Member-only story

Sending syslog from Borg backups to Graylog on Mac OS X

John Wheeler
5 min readJan 22, 2021

--

Syslog message from borg backup script running on remote host

Early in 2020 I spent time learning about borg as a backup technology and documenting a backup strategy. I started by following the quick start guide and documenting the steps I took on my mac mini. To ensure my backups were effective I also tested a restore and documented that process. I was pretty happy with both the technology and the ease of use on a mac.

After spending a bit more time researching how to automate backups I quickly chose Vorta as a backup client. Vorta worked well and had an easy to use UI. One of the things I wanted to do in addition to automating my backups was log the output of a backup and alert on any failures. I didn’t see an easy way to do this in Vorta so I changed my automation strategy to use a script and the native cron daemon. I have this same setup on two mac mini’s and this has been running for about a year.

I spent some time researching how to log from my shell script to the Graylog system that I setup. I ran across this post where the author did a really good job of explaining a strategy for sending script output to syslog. The post is worth a read if you want to know how the clock works. I inserted the line in my script and was poised to watch logs stream into Graylog.

exec 1> >(logger -s -t $(basename $0)) 2>&1

--

--

John Wheeler
John Wheeler

Written by John Wheeler

Security professional, Mac enthusiast, writing code when I have to.

No responses yet