frostming / frostming/flask-crontab

Allow additional configurations to manually extend the crontab execution command

Open
#8 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
101
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Right now, the configuration only allows to adjust the following two parameters:

| Config item | Description | Default value |
| ------------------ | ------------------------------ | ------------------ |
| CRONTAB_EXECUTABLE | The absolute path of `crontab` | `/usr/bin/crontab` |
| CRONTAB_LOCK_JOBS | Whether lock jobs when running | `False` |

However, it would be great if there are two additional configuration variables that allow to add a prefix and a suffix to the command. For example, this could look like the following (taken from the [django-crontab](https://github.com/kraiz/django-crontab) project):

**CRONTAB_COMMAND_PREFIX**

* something you want to do or declare, before each job gets executed. A good place for environment variables.
* default: '' (empty string)
* example: 'STAGE=production'

**CRONTAB_COMMAND_SUFFIX**

* something you want to do after each job was executed.
* default: '' (empty string)
* example: '2>&1'

That would allow me to redirect the output stream with the suffix and set important environment variables with the prefix configuration.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.