Skip to content

Operation and backups (OpenBSD)

What How
Start, stop, status rcctl start flyingmonit, rcctl stop flyingmonit, rcctl check flyingmonit
Is it healthy? curl http://127.0.0.1:8090/health answers {"status":"ok"}
Which version runs? readlink /home/flyingmonit/current, or the page Admin › General
The server's log /home/flyingmonit/tmp/log/erlang.log.* (the newest: ls -t)
The updates' log grep flyingmonit-update /var/log/messages
Maintenance bin/flying_monit eval '...' as _flyingmonit with /etc/flyingmonit.env (a VM of its own)

FlyingMonit runs without Erlang distribution: there is no node to attach to, so the release's remote and rpc do not work -- eval runs code against the database, as the first admin's creation does.

Backups and restore

Every update copies the database first (/home/flyingmonit/backups/, the 10 newest are kept). For backups of your own, copy /home/flyingmonit/db/ while FlyingMonit is stopped, or with sqlite3 ... ".backup ..." while it runs.

Restore a copy

rcctl stop flyingmonit
cp -p /home/flyingmonit/backups/<date>-<version>/flyingmonit.db* /home/flyingmonit/db/
rcctl start flyingmonit

A copy belongs to the release named in its directory: restore it with that release running (below), or with a newer one, which migrates it on start.

Go back to an earlier release

The 3 newest releases stay in /home/flyingmonit/releases/. Its database may already be migrated by the newer release, so go back together with the copy taken before the update:

rcctl stop flyingmonit
ln -sfn /home/flyingmonit/releases/<version> /home/flyingmonit/current
cp -p /home/flyingmonit/backups/<date>-<version>/flyingmonit.db* /home/flyingmonit/db/
rcctl start flyingmonit

The next run of flyingmonit-update installs the newest release again; to stay on the earlier one, take the update out of root's crontab first (crontab -e).