নির্ধারিত কাজ (ক্রন)
এই অধ্যায়টি এখনও অনুবাদ হয়নি, তাই ইংরেজিতে দেখানো হচ্ছে।
এই পাতায়
Some work happens on its own: checking the licence, publishing scheduled blog posts, writing the sitemap, tidying up, and, with Social Auto Post, posting to social media. One cron line, run every minute, starts all of it. Each job then decides whether it is due.
The cron line
cPanel → Cron Jobs → Common Settings: Once Per Minute (* * * * *). In Command put:
/usr/local/bin/php /home/USER/public_html/cron/run.php > /dev/null 2>&1
Admin → Scheduled jobs shows the exact command for your server, with the right folder, under Set up in cPanel, and a Copy button. Paste it into Command as it is: the timing comes from Once Per Minute. Only a crontab file of your own needs the five stars (* * * * *) in front of it.
Some hosts keep PHP elsewhere, such as /usr/bin/php or /opt/cpanel/ea-php81/root/usr/bin/php. Put that in PHP path for the cron line under Options on the same page, and the line shown changes to match.
When the host has no command-line cron
Use the web address instead. Any web-cron service can open it every minute:
https://your-site/cron/run.php?key=YOUR-KEY
The address with your secret key is shown on Admin → Scheduled jobs, with Copy. New address makes a new key; the old address then answers Invalid cron key. and must be replaced wherever you used it.
When there is no cron at all
The site still keeps going. With Run jobs from visits too switched on (it is on by default), the jobs that are due run after a visitor's page has been sent, at most once a minute. The visitor does not wait for them. When a real cron line is working, this does nothing.
The same switch appears under Admin → Settings → Advanced as Let page views run the jobs when there is no cron. A real cron line is still better: jobs then run on time even when nobody visits.
The jobs
| Job | Runs | What it does |
|---|---|---|
| License check | every 12 hours by default | Confirms the licence with license.faruk.bd and fits plugins bought since |
| Scheduled blog posts | every 5 minutes | Publishes posts whose publish time has come |
| Sitemap | daily | Writes sitemap.xml afresh. Waits while Regenerate every day is off under Settings → SEO & Sitemap |
| Housekeeping | daily | Clears expired sign-in tokens, view records older than 60 days, activity older than 180 days, the e-mail log older than 90 days, and old rate-limit files |
| Social auto post | every Post every interval, 1 hour by default | Posts the next ayah to every connected account |
| Daily prayer-times banner | looked at every 15 minutes | Draws the day's prayer times as a picture and posts it once a day at the hour you chose (05:00 by default) |
The last two belong to the premium Social Auto Post plugin and are marked with its name. They appear only while that plugin is on, and they wait until it is switched on under its own settings and at least one account is connected.
The Scheduled jobs page
The line at the top tells you how things stand:
- The jobs last ran 1 minute ago, started by the command line. All is well. It may also say a web cron address or a visitor's page view (web fallback).
- The jobs last ran 3 hours ago … They should run every minute. Something is late; check the cron line.
- The jobs have not run for 2 days. Add the cron line below in cPanel. Nothing is running them.
- Nothing has run the scheduled jobs yet. A new site with no cron yet.
The table lists every job with Every and its State: ok, late, never, off, waiting (with the reason, for example a switch that is off) or failed (with the error).
Beside each job:
- Run now runs it at once and shows what it did.
- The gear opens Run every … minutes (empty: the job's own interval; your own value is marked (yours)) and Switch this job off.
- Log shows its last ten runs: ok or fail, the time, what started it (cron, url, web or admin), how many seconds it took, and what it answered. The last 30 runs of each job are kept.
Run all now at the top runs every job that is ready and not switched off, due or not.
From the command line
Over SSH, in the site's folder:
php cron/run.php # runs what is due
php cron/run.php all # runs every job now
php cron/run.php sitemap # runs one job by its name
The names are license, scheduled_posts, sitemap and tidy, plus social_autopost and prayer_banner from Social Auto Post. A web cron can do the same by adding &job=sitemap to its address.