انتقل إلى المحتوى

الدروس cPanel متوسط1 دقائق قراءة

How to Set Up Cron Jobs in cPanel

Schedule scripts to run automatically with cPanel Cron Jobs: understand cron timing syntax, write commands that work, and replace WordPress WP-Cron.

بواسطة فريق تحرير ZSOLNET آخر تحديث

هذه الصفحة غير متاحة بالعربية بعد، لذا تُعرض بالإنجليزية.

أهم النقاط

  • Cron timing uses five fields: minute, hour, day, month, weekday.
  • Always use full paths to PHP and your script.
  • Replace WP-Cron with a real cron job for reliable scheduled tasks.

A cron job runs a command on a schedule — sending newsletters, clearing caches or running WordPress’s scheduled tasks.

Add a cron job

  1. Open Advanced → Cron Jobs.
  2. Optionally set a Cron Email to receive output (useful while testing, noisy afterwards).
  3. Pick a Common Setting or fill in the five timing fields.
  4. Enter the Command and click Add New Cron Job.

Timing syntax

The five fields are minute, hour, day of month, month and day of week:

*/15 * * * *   every 15 minutes
0 3 * * *      every day at 03:00 (server time)
0 9 * * 1      every Monday at 09:00

Writing the command

Use full paths — cron doesn’t run in your project folder:

/usr/local/bin/php /home/acme/public_html/scripts/report.php

Add >/dev/null 2>&1 at the end to stop emails once it works.

Replace WP-Cron with a real cron job

WordPress runs scheduled tasks on page visits, which is unreliable on quiet sites and wasteful on busy ones.

  1. Add to wp-config.php:
define('DISABLE_WP_CRON', true);
  1. Add a cron job every 5–15 minutes:
/usr/local/bin/php /home/acme/public_html/wp-cron.php >/dev/null 2>&1

Keep the frequency reasonable — very frequent jobs count against your account’s resource limits.

شارك X LinkedIn Facebook

الدخول إلى حسابك

أدِر نطاقاتك واستضافتك وفواتيرك من مكان واحد.

اتصال آمن مباشرة مع منطقة العملاء في ZSOLNET.

ليس لديك حساب؟