# CronSentry (now CronRabbit) - Full Technical Manual > Complete integration instructions, developer documentation, cron syntax guide, and tool details for CronSentry and CronRabbit. - [Back to Main Index](https://www.cronsentry.com/llm.txt) --- ## 1. Introduction to Cron Job Monitoring Cron jobs are often silent failures. They run in the background via daemon executors (like `cron` or `systemd-cron`), meaning that when a job fails, hangs, or crashes, it frequently goes unnoticed until it causes downstream data inconsistencies, missed backups, or business process failures. Common reasons for cron job failures: 1. **Environment Mismatches**: Crontabs run with a restricted shell environment (often `/bin/sh` instead of `/bin/bash`) and minimal `PATH` variables. 2. **Resource Exhaustion**: The script runs out of memory (OOM), disk space, or database connections. 3. **Overlapping Executions**: A previous execution takes longer than the schedule frequency, causing concurrent runs that lock resources or crash. 4. **Network Outages**: External API dependencies are unreachable. CronSentry (now CronRabbit) solves this using **Heartbeat / Push-based Monitoring**. Instead of checking if a server is online, the job itself pings CronRabbit when it runs successfully. If CronRabbit does not receive a ping within a scheduled window (plus a defined grace period), it immediately alerts the developers. --- ## 2. Integration Architectures & Snippets Integrating CronRabbit into your infrastructure is incredibly easy and requires no persistent agents. ### A. The Simple Append Pattern (stdout / stderr ignoring) Simply append a command to ping CronRabbit upon successful execution (`&&`) of your task. ```bash # Ping CronRabbit only if script.sh completes with exit code 0 0 * * * * /path/to/script.sh && curl -s https://endpoint.cronrabbit.com/ping/YOUR-UNIQUE-UUID > /dev/null 2>&1 ``` ### B. The Exit Status Safe Pattern To capture both successes and failures, use a conditional block or inline shell logic. This ensures CronRabbit is notified whether the task succeeded or failed, allowing for rich alerting. ```bash # Capture status and ping appropriate endpoints 0 * * * * /path/to/script.sh; [ $? -eq 0 ] && curl -s https://endpoint.cronrabbit.com/ping/YOUR-UNIQUE-UUID || curl -s https://endpoint.cronrabbit.com/fail/YOUR-UNIQUE-UUID ``` ### C. Advanced Shell Wrapper Script For complex cron jobs, we recommend using a standard wrapper script. This captures the execution duration, standard output (stdout), and standard error (stderr), and posts them to CronRabbit for debugging. ```bash #!/bin/bash # cron-wrapper.sh # Usage: ./cron-wrapper.sh "YOUR-UNIQUE-UUID" /path/to/actual-job.sh arg1 arg2 JOB_ID="$1" shift API_URL="https://endpoint.cronrabbit.com/ping/${JOB_ID}" FAIL_URL="https://endpoint.cronrabbit.com/fail/${JOB_ID}" start_time=$(date +%s%N) # Execute the job and capture output output=$("$@" 2>&1) exit_code=$? end_time=$(date +%s%N) duration_ms=$(( (end_time - start_time) / 1000000 )) if [ $exit_code -eq 0 ]; then # Success: Send duration and standard output curl -s -X POST -H "Content-Type: application/json" \ -d "{\"status\":\"success\", \"duration_ms\": $duration_ms, \"output\": \"$(echo "$output" | tail -c 2000 | jq -sRr @json)\"}" \ "$API_URL" > /dev/null else # Failure: Send exit code and standard error curl -s -X POST -H "Content-Type: application/json" \ -d "{\"status\":\"fail\", \"exit_code\": $exit_code, \"duration_ms\": $duration_ms, \"output\": \"$(echo "$output" | tail -c 2000 | jq -sRr @json)\"}" \ "$FAIL_URL" > /dev/null fi ``` ### D. Systemd Service Integration If you are using systemd timers instead of traditional cron jobs, you can use the `OnFailure` directive in your service unit to trigger notifications, or use `ExecStopPost` to ping CronRabbit on job completion. ```ini # /etc/systemd/system/backup.service [Unit] Description=Daily Database Backup OnFailure=backup-failure@%n.service [Service] Type=oneshot ExecStart=/usr/local/bin/backup-db.sh ExecStopPost=/usr/bin/curl -s https://endpoint.cronrabbit.com/ping/YOUR-UNIQUE-UUID ``` --- ## 3. Visual Cron Generator Tool Details CronSentry provides a fully featured, interactive visual **Cron Generator** tool to help developers build and validate cron schedules without having to parse complex syntax in their heads. ### Cron Format Syntax Guide A standard cron expression consists of 5 fields separated by whitespace: ``` ┌───────────── minute (0 - 59) │ ┌───────────── hour (0 - 23) │ │ ┌───────────── day of the month (1 - 31) │ │ │ ┌───────────── month (1 - 12) │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday; 7 is also Sunday on some systems) │ │ │ │ │ * * * * * ``` ### Supported Special Characters - `*` (Asterisk): Matches all values in the field. (e.g., `*` in the hour field means "every hour"). - `,` (Comma): Separates a list of values. (e.g., `1,3,5` in the day of week field means "Monday, Wednesday, Friday"). - `-` (Hyphen): Defines a range of values. (e.g., `1-5` in the day of week field means "Monday through Friday"). - `/` (Slash): Specifies step increments. (e.g., `*/5` in the minute field means "every 5 minutes"). ### Visual Generator Tool Implementation Our tool is built using clean static HTML, styled with responsive CSS, and powered by robust libraries loaded via CDN: 1. `cronstrue` - Instantly parses cron expressions and generates human-readable text descriptions (e.g. `*/5 * * * *` -> "Every 5 minutes"). 2. `cron-validator` - Fully validates expressions to prevent system configuration crashes before they occur. You can run, validate, and preview your cron strings interactively at: `https://www.cronsentry.com/tools/cron-generator/` --- ## 4. Rebranding: From CronSentry to CronRabbit CronSentry.com is now officially **CronRabbit.com**. The rebranding brings multiple performance, reliability, and security upgrades: - **Global Edge Routing**: Ultra-low latency ping endpoints powered by Cloudflare edge workers. - **Deeper Team Collaborations**: Shared access controls, multi-channel alerting profiles, and unified organization dashboards. - **Robust Integration Ecosystem**: Native integrations with Slack, Microsoft Teams, Discord, Pushover, Opsgenie, and generic custom webhooks. - **Extended History Retention**: Archive execution logs and analytics up to 90 days. All legacy CronSentry configurations are fully backward compatible with CronRabbit.