githubEdit

How to setup CRON jobs in DuploCloud

Setup CRON Jobs Navigate to your DuploCloud tenant where you want to create the CRON job Go to the CRON Jobs section in the DuploCloud UI Create a new CRON job with the following configuration: Name: Give your CRON job a descriptive name Schedule: Set your desired schedule (e.g., every 5 minutes for testing, weekly for production) Container Image: Select the same image used by your main application service Configure the Command field with the proper format. For Django management commands, use: ["python", "manage.py", "your_command_name"] For example: ["python", "manage.py", "cleanup_session_transfer_tokens"] Set up Environment Variables by referencing your existing secrets. Use this structure:

  • name: YOUR_ENV_VAR_NAME valueFrom: secretKeyRef: key: YOUR_ENV_VAR_NAME name: your-secrets-name Configure the TTL (Cleanup After Finished in Seconds) field: Set to 3600 (1 hour) for jobs that run frequently Set to 86400 (1 day) for jobs that run less frequently This prevents accumulation of old completed Job pods while keeping the CronJob itself active Save the CRON job configuration Usage Once your CRON job is configured: Monitor execution: Check the CRON job list in DuploCloud UI to see when jobs last ran and their status Manual testing: You can manually trigger the job to test it before relying on the schedule View logs: Access pod logs to troubleshoot any issues with your commands Environment variables: Ensure all required environment variables from your main service are properly referenced in the CRON job configuration Important: The CRON job will use the default entrypoint of your container image unless you override it with a specific command. Make sure to specify the exact command you want to run, as the container won't automatically know to execute your management commands.

Last updated

Was this helpful?