Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

How to create cron job for WordPress

Cron job

         

tohit

9:32 am on Dec 11, 2014 (gmt 0)

10+ Year Member



Hi to all,

I want to run cron job in 3 steps

Step 1 Have to update sql query
Step 2 Have to update xml
Step 3 Have to update sql query

How to setup these all steps in cpanel...?


If possible give suggestion as per wordpress format because i want to run this 3 steps for 1 wordpress website..... ..

Please guide me how to perform this steps...

[edited by: lorax at 12:36 pm (utc) on Dec 11, 2014]
[edit reason] fix spelling [/edit]

lorax

12:42 pm on Dec 11, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld tohit!

I need a bit more clarity. When you say "Have to update sql query" are you saying a) you need to update a sql query OR b) you want to create a sql query to be run by the cron job?

Same question for steps 2 & 3.

As for the documentation: [documentation.cpanel.net...]

ergophobe

4:48 pm on Dec 11, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



CPanel only provides an interface for crontab. So if you go to your control panel and search on "cron" you'll find it. Then you set the job to run as often as you need.

As for the job you set, you'll need to create either
- a shell script that does what you want
--- or ---
- a wordpress plugin that does what you want and hooks into cron.

Remember, cron only schedules the jobs. It's up to you to create the job and this is *not* a CPanel thing.

There are plugins that do various forms of database maintenance on cron runs and plugins for various xml tasks (like creating sitemaps). But as lorax says, without details on what you're trying to do, there's no more specific answer possible for this question.