9.9 KiB
ATTENTION BREAKING UPDATE!!
The latest
mainbranch has completely changed the way this app used to run. The main reason being trying to address some security concerns and make the whole application work across multiple platform without too much trouble.If you came here due to this change trying to figure out why your app stopped working you have two options:
1 - Update your
docker-compose.ymlwith the new one provided within this readme (or just copy docker-compose.yml)2 - Keep your
docker-compose.ymlfile as it is and use the legacy tag in the imageimage: ghcr.io/fccview/cronmaster:legacy. However bear in mind this will not be supported going forward, any issue regarding the legacy tag will be ignored and I will only support the main branch. Feel free to fork that specific branch in case you want to work on it yourself :)
Features
- Modern UI: Beautiful, responsive interface with dark/light mode.
- System Information: Display hostname, IP address, uptime, memory, network and CPU info.
- Cron Job Management: View, create, and delete cron jobs with comments.
- Script management: View, create, and delete bash scripts on the go to use within your cron jobs.
- Docker Support: Runs entirely from a Docker container.
- Easy Setup: Quick presets for common cron schedules.
Before we start
Hey there! 👋 Just a friendly heads-up: I'm a big believer in open source and love sharing my work with the community. Everything you find in my GitHub repos is and always will be 100% free. If someone tries to sell you a "premium" version of any of my projects while claiming to be me, please know that this is not legitimate. 🚫
If you find my projects helpful and want to fuel my late-night coding sessions with caffeine, I'd be super grateful for any support! ☕
Quick Start
Using Docker (Recommended)
- Create a
docker-compose.ymlfile with this content:
services:
cronjob-manager:
image: ghcr.io/fccview/cronmaster:1.2.1
container_name: cronmaster
user: "root"
ports:
# Feel free to change port, 3000 is very common so I like to map it to something else
- "40124:3000"
environment:
- NODE_ENV=production
- DOCKER=true
- NEXT_PUBLIC_CLOCK_UPDATE_INTERVAL=30000
- HOST_PROJECT_DIR=/path/to/cronmaster/directory
# If docker struggles to find your crontab user, update this variable with it.
# Obviously replace fccview with your user - find it with: ls -asl /var/spool/cron/crontabs/
# - HOST_CRONTAB_USER=fccview
volumes:
# Mount Docker socket to execute commands on host
- /var/run/docker.sock:/var/run/docker.sock
# These are needed if you want to keep your data on the host machine and not wihin the docker volume.
# DO NOT change the location of ./scripts as all cronjobs that use custom scripts created via the app
# will target this foler (thanks to the HOST_PROJECT_DIR variable set above)
- ./scripts:/app/scripts
- ./data:/app/data
- ./snippets:/app/snippets
# Use host PID namespace for host command execution
# Run in privileged mode for nsenter access
pid: "host"
privileged: true
restart: unless-stopped
init: true
# Default platform is set to amd64, uncomment to use arm64.
#platform: linux/arm64
ARM64 Support
The application supports both AMD64 and ARM64 architectures:
For AMD64 users: No changes needed - the default configuration works out of the box.
For ARM64 users: Uncomment the platform line in your docker-compose.yml:
platform: linux/arm64
Note: Multi-platform Docker images are automatically built for both architectures. The image will automatically use the correct architecture for your platform.
- Build and run with Docker Compose:
docker compose up --build
- Open your browser and navigate to
http://localhost:40123
Note: The Docker implementation uses direct file access to read and write crontab files, ensuring real-time synchronization with the host system's cron jobs. This approach bypasses the traditional crontab command limitations in containerized environments
Local Development
- Install dependencies:
yarn install
- Run the development server:
yarn dev
- Open your browser and navigate to
http://localhost:3000
Environment Variables
The following environment variables can be configured:
| Variable | Default | Description |
|---|---|---|
NEXT_PUBLIC_CLOCK_UPDATE_INTERVAL |
30000 |
Clock update interval in milliseconds (30 seconds) |
HOST_PROJECT_DIR |
N/A |
Mandatory variable to make sure cron runs on the right path. |
DOCKER |
false |
ONLY set this to true if you are runnign the app via docker, in the docker-compose.yml file |
Example: To change the clock update interval to 60 seconds:
NEXT_PUBLIC_CLOCK_UPDATE_INTERVAL=60000 docker-compose up
Example: Your docker-compose.yml file or repository are in ~/homelab/cronmaster/
HOST_PROJECT_DIR=/home/<your_user_here>/homelab/cronmaster
Important Notes for Docker
- Root user is required for cron operations and direct file access. There is no way around this, if you don't feel comfortable in running it as root feel free to run the app locally with
yarn install,yarn buildandyarn start - Crontab files are accessed directly via file system mounts at
/host/cron/crontabsand/host/crontabfor real-time reading and writing HOST_PROJECT_DIRis required in order for the scripts created within the app to run properly- The
DOCKER=trueenvironment variable enables direct file access mode for crontab operations. This is REQUIRED when running the application in docker mode.
Usage
Viewing System Information
The application automatically detects your operating system and displays:
- Platform
- Hostname
- IP Address
- System Uptime
- Memory Usage
- CPU Information
- GPU Information (if supported)
Managing Cron Jobs
- View Existing Jobs: All current cron jobs are displayed with their schedules and commands
- Create New Jobs: Use the form on the right side to create new cron jobs
- Quick Presets: Click on preset buttons for common schedules
- Add Comments: Include descriptions for your cron jobs
- Delete Jobs: Remove unwanted cron jobs with the delete button
- Clone Jobs: Clone jobs to quickly edit the command in case it's similar
Cron Schedule Format
The application uses standard cron format: * * * * *
- First field: Minute (0-59)
- Second field: Hour (0-23)
- Third field: Day of month (1-31)
- Fourth field: Month (1-12)
- Fifth field: Day of week (0-7, where 0 and 7 are Sunday)
Managing Scripts
- View Existing Scripts: All current user created scripts are displayed with their name and descriptions
- Create New Script: Use the editor and snippets to quickly create scripts for your cron jobs.
- Quick Snippets: Pre-set of snippets, with ability to add new ones. Check README.md in Snippets
- Delete Scripts: Remove unwanted scripts (this won't delete the cronjob, you will need to manually remove these yourself)
- Clone Scripts: Clone scripts to quickly edit them in case they are similar to one another.
Technologies Used
- Next.js 14: React framework with App Router
- TypeScript: Type-safe JavaScript
- Tailwind CSS: Utility-first CSS framework
- Lucide React: Beautiful icons
- next-themes: Dark/light mode support
- Docker: Containerization
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Community shouts
I would like to thank the following members for raising issues and help test/debug them!
|
hermannx5 |
edersong |
corasaniti |
abhisheknair |
mariushosting |
License
This project is licensed under the MIT License.
Support
For issues and questions, please open an issue on the GitHub repository.


