Skip to content

Cron jobs

What are cron jobs

Cron jobs are a way to periodically launch an app. This is useful to launch R or Python scripts doing a calculation before shutting themselves off. The Cron jobs section of the app details page will list cron jobs, where you can create, edit or delete cron jobs from this section.

Cron jobs have some settings. Choose a name, a status (active or inactive), and an interval:

  • Hourly will start the app each hour at a specific minute;
  • Daily will start the app each day at a specific hour;
  • Weekly will start the app each week on a specific day and time.

You can add several cron jobs for a same app.

Stopping an app

Danger

Please read this carefully before creating your first cron job.

When an app is launched by a cron job, you have to make the app stop itself:

  • R and Shiny apps or scripts can be stopped with q();
  • Python, Dash and Streamlit apps or scripts can be stopped with sys.exit(0);
  • Apleno Designer apps can be stopped with rpgm.quit().

If you don't stop/exit an app, R/Python will continue to run indefinitely. For example, running an hourly app for 10 hours would result in 10 instances running in the background and consuming the server CPU and RAM.