My cron job is not working


#1

I recently created a hosting, uploaded my files, created a database and checked that everything works properly, but when tryed to set a cron job, it doesn’t execute my script.

My script is executed perfectly when visiting https://huerto.000webhostapp.com/alerta.php. It sends me a mail like I want, and it’s into public_html folder.

The code is:

<?php $para = 'pepon2391@gmail.com'; $titulo = 'Prueba cron'; $mensaje = 'Cron correcto'; $cabeceras = 'From: admin@huerto.com' . "\r\n" . 'Reply-To: admin@huerto.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($para, $titulo, $mensaje, $cabeceras); exit; ?>

When trying to create a new cron job I set it like that, but this doesn’t work.

Thanks for the help!


#2

It may take some time for the cron job to activate :slight_smile:


#3

I’m having the same issue with cron jobs. But I had a cron job that was working and today I found it doesn’t work anymore


#4

Cron jobs may work and not work, depending if that job failed or succeeded to be executed :slight_smile:


#5

In other words, it doesn’t works because it doesn’t worked. Nice.


#6

Let me explain how a cron job works:

  1. You create a cron job
  2. The server, when the time for the cron job comes, creates a job for itself, and executes it
  3. Our servers normally have tons of jobs pending
  4. That’s why there might be sometimes a delay in executing the cron jobs (and for waking up sleeping websites)
  5. The cron job may fail to execute sometimes :slight_smile:

#7

But currently there has to be some technical problem with this. They are not working well, at least not for him or me.

We both have scripts that work well when accessed manually, but cron job isn’t running them.
My script is the same as the one that’s been running for the last month.

Edit: It’s not once in a while that fails, that’s understandable. Right now it’s not running at all.


#8

@leandropb

I’ll forward this to our developers :slightly_smiling_face:


#9

Update:

The latest feature created by our awesome developers will help you to fix the problem. Let us know what happens next :wink:


#10

I tried that, but now the website doesn’t respond. I will wait a while to see if this continue


#11

Okey, it’s been a few hours and it’s still the same. The repair option disabled my website instead of solve the cron job issue


#12

I’m sorry for the issue, our developers will work on that problem Monday


#13

I had schedule cron job for every 10 minutes interval on 28th Jan 2018. According to 10 minutes interval it should get execute 6 times in 1 hour, but it was getting executed only 3 time(after 10 minutes, 20 minutes and 30 minutes) in 1 hour.

I think, after 12th Feb 2018 it was not executed for single time.

So, I delete old cron job and tried to create new cron job. While creating new cron job it is giving following error ‘An internal error has occur. Our developers have already been notified’.

Kindly help to solve this issue.


#14

Again, please wait :slight_smile: