Skip to content

Latest commit

 

History

History
82 lines (54 loc) · 3.31 KB

README.md

File metadata and controls

82 lines (54 loc) · 3.31 KB

Join our community Follow @geneziodev

Genezio Cron Python Getting Started

This is a simple example of how to create a cron job using Genezio and Python.

Project Structure

  • index.py - Contains the handler function that runs every hour, logging the execution time and returning a 200 status response
  • genezio.yaml - Configuration file that defines the cron schedule and endpoint
  • requirements.txt - Contains the dependencies for the project

Cron Configuration

The cron job is configured to run every hour (at minute 0) using the cron expression 0 * * * * in the genezio.yaml file, at the / endpoint.

Function Details

The handler function:

  • Prints the current execution time
  • Logs any incoming event data

Testing

You can test the endpoint manually by accessing it with your browser or using tools like curl/Postman.

Deploy

🚀 You can deploy your own version of the template to Genezio with one click:

Deploy to Genezio

Genezio CLI Commands

Genezio also provides a CLI tool that you can use to deploy your project from your machine. All commands are run from the root of the project, from a terminal:

Command Action
npm install -g genezio Installs genezio globally
genezio login Logs in to genezio
genezio local Starts a local server
genezio deploy Deploys a production project
genezio --help Get help using genezio

Learn more

To learn more about Genezio, take a look at the following resources:

Contact

If you need support or you have any questions, please join us in our Discord channel. We'd love to chat!

Built With