Other languages / Другие языки / Забонҳои дигар: Русский Тоҷикӣ

A Cron Job is a task the server runs on a schedule: every minute, daily at 3 AM, weekly, etc. Used for backups, mailings, data updates, cache cleaning.

Where to find it

  1. Log into cPanel
  2. Advanced → Cron Jobs

Creating a job

  1. In Email set your address — output will be mailed (or leave empty)
  2. In Common Settings pick a preset or set manually:
    • Minute: 0–59
    • Hour: 0–23
    • Day: 1–31
    • Month: 1–12
    • Weekday: 0–6 (0=Sunday)
  3. In Command enter:
    php /home/USER/public_html/cron.php
    cd /home/USER/scripts && bash backup.sh
    wget -q -O - https://site.tj/cron/run
  4. Click Add New Cron Job

Schedule examples

  • Every minute: * * * * *
  • Every hour at minute 0: 0 * * * *
  • Daily at 3:30 AM: 30 3 * * *
  • Every Sunday at 6 AM: 0 6 * * 0
  • Every 15 minutes: */15 * * * *

Tips

  • Don't run more than once a minute — overloads the server
  • Long jobs — start via SSH + nohup or with a timestamp
  • Log output: append >> /home/USER/cron.log 2>&1 at the end
  • Use full PHP/python paths: /usr/local/bin/php
Byla tato odpověď nápomocná? 0 Uživatelům pomohlo (0 Hlasů)