The aim for this project is for dockerized environments. Containerized tasks asks for a containerized manager.
You will probably want your tasks to persist after container recreation. So create a volume, and pass it as a mountpoint.
docker volume create cronmanager-dataYou will also want the job manager to access your other containers, so it can manage them. For that, pass /var/run/docker.sock as a mountpoint.
This is a cronjob schedule related image, which is very time sensitive. So it is very important to get the your time settings right. Luckily this image supports the TZ environment var for setting the timezone, so no worries. Just make sure to get it right like in the example below.
The container exposes port 80 for using the web interface and the API, just forward that port to a port on your host. The web interface is located at http://your.hostname:port/. The API docs are below.
Now to run the image:
docker run \
-p 80:80 \
-v cronmanager-data:/usr/src/app/.node-persist \
-v /var/run/docker.sock:/var/run/docker.sock \
-e TZ="America/Sao_Paulo" \
edmur/cronjob-managerThe web interface uses a REST API on the back-end that can also be called externally.
GETInformation
Retrieve information about crontab.
http://your-host/api/info
GETTime
Get current server date and time information.
http://your-host/api/time
GETJobs
Retrieve a list of existing jobs.
http://your-host/api/jobs
GETJob
Retrieve information about specific Job.
http://your-host/api/jobs/{id}
GETJob Logs
Retrieve logs from specific Job.
http://your-host/api/jobs/{id}/logs
DELETEJob
Delete a Job.
http://your-host/api/jobs/{id}
POSTJobs
Create a new Job.
http://your-host/api/jobs
| Field | Type | Value |
|---|---|---|
| Content-Type | String | application/json |
| Field | Type | Description |
|---|---|---|
| name | String | A custom name for your Job. |
| cron | String | The cron schedule expression. |
| command | String | The name of the container to run. |
| commandType | String | The command to execute on the container. |
| active | Boolean | If the job is enabled or not. |
PUTJobs
Update information of existing job.
http://your-host/api/jobs/{id}
| Field | Type | Value |
|---|---|---|
| Content-Type | String | application/json |
| Field | Type | Description |
|---|---|---|
| name | String | A custom name for your Job. |
| cron | String | The cron schedule expression. |
| command | String | The name of the container to run. |
| commandType | String | The command to execute on the container. |
| active | Boolean | If the job is enabled or not. |
- Have more ideas...
This project is open-source software licensed under the MIT license.
