https://github.com/shinthan001/cronmanager
This is a simple web app to turn on/off cron job running in Linux server. This app allows non-techincal users to edit cron job easily without crontab knowledge.
https://github.com/shinthan001/cronmanager
cronjob fastapi jinja-template python3
Last synced: 10 months ago
JSON representation
This is a simple web app to turn on/off cron job running in Linux server. This app allows non-techincal users to edit cron job easily without crontab knowledge.
- Host: GitHub
- URL: https://github.com/shinthan001/cronmanager
- Owner: shinthan001
- Created: 2025-02-22T03:45:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-23T07:00:46.000Z (over 1 year ago)
- Last Synced: 2025-02-23T07:28:55.689Z (over 1 year ago)
- Topics: cronjob, fastapi, jinja-template, python3
- Language: Python
- Homepage:
- Size: 380 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Cron Manager
This is a simple web app to turn on/off cron job running in Linux server. This app allows non-techincal users to edit cron job easily without crontab knowledge.
## Table of Contents
- [Project Setup](#project-setup)
- [Usage](#usage)
- [Kill Server](#kill-server)
- [Project Structure](#project-structure)
## Project Setup
1. Prerequisites: python3.6, pip21.3.1
2. Create virtual env.
```
python -m venv venv_linux
```
3. Activate virtual env.
```
source venv_linux/bin/activate.csh
```
4. Install requirements.txt.
```
pip install requirements.txt
```
5. Setup desired username and password in `./env/env`.
```
CRONMGR_USER=
CRONMGR_PASS=
```
6. Generate desired secrete key
```
openssl rand -hex 32
```
and save in `./env/env`.
```
SECRET_KEY=
```
7. Setup your desired location to save cronfile in `./env/env`.
```
CRON_FILE=
```
8. Run shell script to launch server.
```
./cronmgr.sh
```
## Usage
- Open `url http://:9090` in your browser.
- Toggle buttons to turn on and off specific cronjob.
- Ensure to click save button at the end of web page to make changes. Otherwise, all changes will be lost.
- Since cronjobs are simply saved in flat file, multiple users editing at the same time might cause problem.
- Importantly, your cronjob must be saved in the following format to be rendered in webapp.
```
*/3 * * * * #
```

## Kill Server
- Server process id is stored in `server.pid` once server is launched. Simply kill it.
```kill ```
## Project Structure
- This is simple architecture of this project. FastAPI server hosts endpoints on Linux server and user makes changes to cronfile via web app.