An open API service indexing awesome lists of open source software.

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.

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.