How to deploy a scheduled Checkpoint with cron¶
This guide will help you deploy a scheduled Checkpoint with cron.
Prerequisites: This how-to guide assumes you have already:
Steps¶
Show Docs for V2 (Batch Kwargs) API
First, verify that your Checkpoint is runnable via shell:
great_expectations checkpoint run my_checkpoint
Next, to prepare for editing the cron file, you’ll need the full path of the project’s
great_expectations
directory.Next, get full path to the
great_expectations
executable by running:
which great_expectations
/full/path/to/your/environment/bin/great_expectations
Next, open the cron schedule in a text editor. On most operating systems,
crontab -e
will open your cron file in an editor.To run the Checkpoint
my_checkpoint
every morning at 0300, add the following line in the text editor that opens:
0 3 * * * /full/path/to/your/environment/bin/great_expectations checkpoint run ratings --directory /full/path/to/my_project/great_expectations/
Finally save the text file and exit the text editor.
The five fields correspond to the minute, hour, day of the month, month and day of the week.
It is critical that you have full paths to both the great_expectations
executable in your project’s environment and the full path to the project’s great_expectations/
directory.
If you have not used cron before, we suggest searching for one of the many excellent cron references on the web.
Show Docs for V3 (Batch Request) API
First, verify that your Checkpoint is runnable via shell:
great_expectations --v3-api checkpoint run my_checkpoint
Next, to prepare for editing the cron file, you’ll need the full path of the project’s
great_expectations
directory.Next, get full path to the
great_expectations
executable by running:
which great_expectations
/full/path/to/your/environment/bin/great_expectations
Next, open the cron schedule in a text editor. On most operating systems,
crontab -e
will open your cron file in an editor.To run the Checkpoint
my_checkpoint
every morning at 0300, add the following line in the text editor that opens:
0 3 * * * /full/path/to/your/environment/bin/great_expectations --v3-api checkpoint run ratings --directory /full/path/to/my_project/great_expectations/
Finally save the text file and exit the text editor.
The five fields correspond to the minute, hour, day of the month, month and day of the week.
It is critical that you have full paths to both the great_expectations
executable in your project’s environment and the full path to the project’s great_expectations/
directory.
If you have not used cron before, we suggest searching for one of the many excellent cron references on the web.