---
title: "Managed scheduled jobs"
date: "2024-02-14T06:18:38+00:00"
summary: "Easily manage and schedule periodic tasks for your Drupal site with our guide to scheduled jobs. Learn how to set up cron jobs, automate processes, and optimize your website's performance."
image:
type: "page"
url: "/service-offerings/managed-scheduled-jobs"
id: "5629c00c-35e1-4639-9516-cd0b69ed3710"
---

Schedule jobs help you run periodic tasks such as Drupal cron, or bespoke processing such as content ingestion or export.

Note

While [Cloud Platform](/acquia-cloud-platform) provides a [Scheduled jobs](/acquia-cloud-platform) user interface, Acquia China Managed Services allows access directly to crontab Task Server.

Prerequisites
-------------

To set up cron jobs for a specific environment, you need to have [SSH access](/service-offerings/china-managed-services/environments) to the environment’s target server.

Creating scheduled jobs
-----------------------

1.  SSH to the target server.
    
    The target server for each environment is different.
    
    *   For the production environment, you need to set up cron jobs on Task Server.
        
    *   For the non-production environment, you can set up cron jobs on the server directly.
        
2.  Edit the crontab file with the following command:
    
        crontab -e
    
3.  Create a scheduled job. The following example command runs cron every 15 minutes and logs the output to a file, which is then rotated every day and gzipped after a date:
    
        # site cron will be triggered every 15 minutes
        DATE_TAG=`date +%Y%m%d`
        */15 * * * * drush core-cron -l [site-uri] 2>&1 >> /mnt/logs/drush-cron/cron.log
        0 0 * * * mv /mnt/logs/drush-cron/cron.log /mnt/logs/drush-cron/cron-${DATE_TAG}.log 2>&1 > /dev/null
        3 0 * * * find /mnt/logs/drush-cron -name \*.log -ctime -1d -exec gzip {} \; 2>&1 > /dev/null
    
    `[site-uri]` is the domain of your site.