Schedule a cron job to run at a specific time

  • Posts: 128
  • Thank you received: 3
8 years 7 months ago #236997

-- HikaShop version -- : 2.5.1
-- Joomla version -- : 3.5.0
-- PHP version -- : 5.3.24

I'm looking to create a plugin that uses the cron trigger to call a function once a month. I'm wanting to call the function on the first day of the month at 9:00 AM. Is there a way I can set the cron trigger to do this?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 7 months ago #237001

Hi,

Well, if you configure your cron task to be called every hour, the onHikashopCronTrigger function of your plugin will be called every hour.
It's then up to the plugin itself to check whether to do something or not.
So in that function, you shoudl check the day and the hour and then run your custom code only when necessary.

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum