# Cron

## Select the running environment

The first step to develop a new cron type plugin is to determine what environment is going to be used:

* Python
* NodeJS

## Create the file structure

Set up a directory structure with the following files

```
├── src
│   ├── control.py or control.js  
│   ├── function.py or function.js
│   ├── view.xml
├── LICENSE
├── README.md
├── manifest.toml 
```

## control and function scripts

Fill those files with the content that you require according to the table below, then save them.

<table data-full-width="true"><thead><tr><th width="125">Script</th><th width="315">Executed </th><th width="486">Purpose</th></tr></thead><tbody><tr><td>control</td><td>Only once when the plugin is created</td><td>Perform one time setup tasks</td></tr><tr><td>function</td><td>Periodically according to the frequency set</td><td>Perform time-triggered tasks</td></tr></tbody></table>

## view\.xml

Populate this file with content based on the form you'd like displayed when creating this plugin.

## LICENSE and README.md

Write the contents of the README.md and LICENSE and files.&#x20;

## manifest.toml&#x20;

According to the cron section within the Private Plugins page, the manifest.toml should look like:

```
manifest_version = 2.0
 
[settings] 
version = "1.0.56" 
runtime = "python3.11" <- replace accordingly 
plugin_type = "cron"  <- fixed value. Don't change
license_name = "MIT license" 

[settings.cron] 
interval = 1 
run_on_deploy = false

[pricing]
price = 0 
```

## Compressing the files

Compress the files in zip format from the root of the file structure, not the parent folder.
