Manage and monitor cron jobs from Strapi admin panel.
- GUI integrated with Strapi admin panel
- tasks scheduling tool incorporating start/end dates and iterations counter
- script logs & monitoring
- Run the following command from the Strapi app root directory.
[npm|yarn|bun] add @innovato/strapi-plugin-cron
- Update or create
./config/plugins.ts
file with the following config:
export default () => ({
'strapi-plugin-cron': {
enabled: true,
resolve: './src/plugins/strapi-plugin-cron',
},
})
- Run the build command from the Strapi app root directory.
[npm|yarn|bun] run build
If you want to maintain your cron job script files within the parent project and track them with a VCS, you should place them in a location relative to <your-strapi-project>/src/extensions/strapi-plugin-cron/
.
The script file should be a .ts
module which exports an async function:
module.exports = async ({ strapi, cronJob }) => {
};
The function has access to strapi
global variable and the relevant cronJob
object.
The script snippet maintained via the Cron plugin dashboard has a direct top-level access to those parameters.
A supplementary repository for development is available here @mjnoach/strapi--strapi-plugin-cron