How to configure a cron job using CloudFlare DNS

Procédure

Why don't my crons work with CloudFlare?

You have linked your domain to CloudFlare using the latter's DNS and you want to configure a cron task from your customer area in the associated section, but the task only executes once without repeating itself at the time interval you wanted. This is a known problem, CloudFlare blocks the execution of crons sent from our services. To overcome this problem, here's a workaround.

Running a cron job using CloudFlare

The cron tasks configured from the customer area don't work if you use CloudFlare DNS. To overcome this problem, please follow this procedure:

  1. Create a sub-domain (for example: cron.domain.ext) from your client space by following this documentation: https://help.lws-hosting.com/en/sub-domains
  2. Place the file to be executed by your cron job in the folder bearing the name of your sub-domain on your hosting's FTP space.
  3. Create your cron job from the client space by following this documentation: https: //help.lws-hosting.com/en/cron-stain
  4. Connect to your CloudFlare account linked to your domain name.

In the "DNS" section, add a CNAME record as shown in the following example:

How to configure a cron job using CloudFlare DNS

Replace "cron" with the name of your sub-domain.

Replace "domain.ext" with your domain name.

Make sure that the cloud is grey and not orange. This tells CloudFlare that you don't want to use its services for this sub-domain.

You can then click on the "Add Record" button.

Rate this article :

5/5 | 1 opinion

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

1mn reading

How do I configure PHP on my hosting?

2mn reading

How do I create a cron job?

3mn reading

Customisation of error pages

0mn reading

How to access Apache / Php logs


Ask the LWS team and its community a question