Save the output of cron shell scripts to a sqlite db
  • Go 80.4%
  • templ 17.4%
  • Just 1.3%
  • CSS 0.5%
  • Shell 0.4%
Find a file
2026-04-26 17:25:48 +02:00
.claude Create a new GRPC backend (#5) 2026-03-30 16:49:56 +00:00
.images Create a new GRPC backend (#5) 2026-03-30 16:49:56 +00:00
.vscode Create a new GRPC backend (#5) 2026-03-30 16:49:56 +00:00
certs Create a new GRPC backend (#5) 2026-03-30 16:49:56 +00:00
cmd fix(runner): use fresh context for result-reporting Execute call 2026-04-18 12:28:16 +02:00
config Create a new GRPC backend (#5) 2026-03-30 16:49:56 +00:00
litestream Create a new GRPC backend (#5) 2026-03-30 16:49:56 +00:00
logging Create a new GRPC backend (#5) 2026-03-30 16:49:56 +00:00
proto feat: small change in server, show selected app color 2026-04-01 16:36:01 +02:00
server chore: add some colors 2026-04-18 12:52:27 +02:00
store feat: add runner colors 2026-04-18 12:47:39 +02:00
text feat: use local LLM to help add testcases 2026-04-26 17:25:48 +02:00
.air.toml Create a new GRPC backend (#5) 2026-03-30 16:49:56 +00:00
.editorconfig feat: move the configuration to the database 2025-12-21 15:16:03 +01:00
.gitattributes Initial import 2025-12-01 17:07:22 +01:00
.gitignore Add execution time to results and extend the max length of the ouptut (#6) 2026-03-31 10:28:40 +00:00
CLAUDE.md doc: tell CLAUDE that we have a justfile. 2026-03-31 12:52:31 +02:00
development.yaml Create a new GRPC backend (#5) 2026-03-30 16:49:56 +00:00
doc.go Create a new GRPC backend (#5) 2026-03-30 16:49:56 +00:00
environments.go Create a new GRPC backend (#5) 2026-03-30 16:49:56 +00:00
go.mod chore(go.mod): update versions 2026-04-03 11:57:18 +02:00
go.sum chore(go.mod): update versions 2026-04-03 11:57:18 +02:00
justfile chore(go.mod): update versions 2026-04-03 11:57:18 +02:00
LICENSE Initial commit 2025-12-01 17:06:40 +01:00
README.md feat: add information on how to start development 2026-04-01 11:59:00 +02:00
runner.yaml Create a new GRPC backend (#5) 2026-03-30 16:49:56 +00:00
TODO.md feat: Use justfile instead of Makefile 2026-03-31 12:51:15 +02:00

Cronlogger

system-overview

Development

In order to compile the protobuf files and generate the necessary GRPC code the following tools need to be installed.

1. Protoc

The protobuf compiler needs to be installed: https://protobuf.dev/installation/. It is as simple as downloading the binaries and put them into the path.

2. GRPC generator

We also need the GRPC generator extension for golang

go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

3. Justfile

Instead of a Makefile a justfile is used (https://github.com/casey/just).

sudo apt install just

Deployment

A simple git-deployment was established for the target-system following ths gist: https://gist.github.com/noelboss/3fe13927025b89757f8fb12e9066f2fa

# steps performed on the target-system

# the target folder to clone artifacts to
mkdir ~/cronlogger.deployment

# create a deployment git-repo
git init --bare ~/cronlogger.git

# create a post-receive hook script
touch cronlogger.git/hooks/post-receive
chmod +x post-receive

# -----------------------------------------------------------------------------------
# local/development system
# add remote on local/development system
git remote add production user@system:cronlogger.git

The post-receive hook takes care of the deployment

post-receive:

#!/bin/bash
TARGET_FOLDER="/path/to/cronlogger.deployment"
DEPLOYMENT_FOLDER="/usr/local/bin"
CONFIG_FOLDER="/etc/cronlogger"
GIT_DIR="/path/to/cronlogger.git"
BRANCH="main"

while read oldrev newrev ref
do
        # only checking out the master (or whatever branch you would like to deploy)
        if [ "$ref" = "refs/heads/$BRANCH" ];
        then
                echo "Ref $ref received. Deploying ${BRANCH} branch to production..."
                git --work-tree=$TARGET_FOLDER --git-dir=$GIT_DIR checkout -f $BRANCH
                sudo cp -f ${TARGET_FOLDER}/cronlogger_server ${DEPLOYMENT_FOLDER}/cronlogger_server
                sudo systemctl restart cronlogger_server
                sudo systemctl status cronlogger_server
                echo "Deployment done; server restarted; have fun!"
        else
                echo "Ref $ref received. Doing nothing: only the ${BRANCH} branch may be deployed on this server."
        fi
done