This application provides a single, cohesive solution for persistent job scheduling, execution, and management, designed for administrators needing reliable automation.
| Component | Technology | Role |
| Backend/Scheduler | Go | Handles API, authentication, data persistence, and CRON-based script execution. |
| Database | SQLite | Stores job definitions and user credentials persistently on disk (jobs.db). |
| Frontend | HTML, Tailwind CSS, JS | Single-page application (SPA) for real-time monitoring and management. |
-
Persistent CRON Scheduling: Jobs are stored in the database and re-loaded automatically when the server starts, ensuring schedules survive restarts.
-
6-Field CRON Support: Utilizes a cron parser that supports second-level precision (Seconds, Minutes, Hours, Day of Month, Month, Day of Week).
-
Shell Script Execution ("The Bot"): Executes script content using /bin/bash -c, enabling the use of standard shell commands and local binaries (e.g., bash, python, node, etc.).
-
Execution Logging: All scheduled attempts, successful executions, and failures (including script output) are logged directly to the Go server's console for easy monitoring.
-
Full CRUD API: Administrators can Create, Read, Update, and Delete job definitions via the web interface.
-
Real-time Scheduler Reload: Any modification (create, update, delete) automatically triggers a graceful stop and reload of the internal CRON scheduler to apply changes instantly without requiring a full server restart.
-
Job Details: Each job card displays its name, description, script content, creation time, CRON expression, and critical status indicators.
The jobs list API (/api/jobs/) supports filtering and sorting via query parameters:
-
Search (
?q=): Filter jobs by matching text in title or descriptionGET /api/jobs/?q=backup # Find jobs with "backup" in title/description -
Sort (
?sort=): Control the order of resultsalphabetical- Sort by job title (A-Z)date_created- Sort by creation date (newest first)date_modified- Sort by last modification date (newest first)next_schedule- Sort by next scheduled run time (soonest first)
GET /api/jobs/?sort=next_schedule # Show jobs ordered by next run time
Parameters can be combined:
GET /api/jobs/?q=backup&sort=date_modified
The web interface provides a search box and sort dropdown that use these parameters. Your chosen search and sort preferences persist across page reloads and are reflected in the URL (e.g. /?q=backup&sort=next_schedule).
The Skip Count feature provides temporary execution control without modifying the CRON schedule itself.
-
One-Click Skip: The Skip (Add 1) action increments the job's SkipCount.
-
Effective Next Run Calculation: The backend dynamically calculates the Next Run (Effective) time by advancing the schedule forward by the number of pending skips. This means the displayed time is the true next time the script will run.
-
Job Lifecycle Integration: When a scheduled time arrives, if SkipCount > 0, the job decrements the count and skips execution, maintaining the job's position in the CRON cycle.
-
JWT Authentication: All API endpoints are protected by JWT tokens, requiring a successful username/password login.
-
Secure Password Storage: The server uses Bcrypt hashing for storing user passwords in the database.
-
User Interface: The interface is built with Tailwind CSS for a clean, responsive, and modern administrative experience.
#!/bin/bash
osascript -e 'display dialog "Your script ran successfully" with title "Hello from Bash" giving up after 2'