Skip to main content
edited body
Source Link
Giacomo1968
  • 56.1k
  • 23
  • 167
  • 214

Consider the following cron job:

* 22-23 * * * /usr/bin/curl -u username:paswword http://api.example.com/api/test2.php

Now, according to this, the cron job must run every minute starting from 22h00 (UTC) but it doesn't. It starts before that time and also not for the full hour. So I wrote the execution time to a database table, just to see what's going on. Here is what I get:

database entries screenshot

The systemDateTime represents when the cron job executes. As you can see, it only executed 6 times and it started about 6 minutes before the scheduled time.

Is this system configuration related? The cron job is on a Apache shared server. Am I missing something or what?

UPDATEUpdate I: I use the following phpPHP code to get the system date time and my timezone date time:

$systemDateTime = date('Y-m-d H:i:s');
$dateNow = new DateTime("now", new DateTimeZone('GMT+2'));
$zoneDateTime = $dateNow->format('Y-m-d H:i:s');  

Consider the following cron job:

* 22-23 * * * /usr/bin/curl -u username:paswword http://api.example.com/api/test2.php

Now, according to this, the cron job must run every minute starting from 22h00 (UTC) but it doesn't. It starts before that time and also not for the full hour. So I wrote the execution time to a database table, just to see what's going on. Here is what I get:

database entries screenshot

The systemDateTime represents when the cron job executes. As you can see, it only executed 6 times and it started about 6 minutes before the scheduled time.

Is this system configuration related? The cron job is on a Apache shared server. Am I missing something or what?

UPDATE I use the following php code to get the system date time and my timezone date time:

$systemDateTime = date('Y-m-d H:i:s');
$dateNow = new DateTime("now", new DateTimeZone('GMT+2'));
$zoneDateTime = $dateNow->format('Y-m-d H:i:s');  

Consider the following cron job:

* 22-23 * * * /usr/bin/curl -u username:paswword http://api.example.com/api/test2.php

Now, according to this, the cron job must run every minute starting from 22h00 (UTC) but it doesn't. It starts before that time and also not for the full hour. So I wrote the execution time to a database table, just to see what's going on. Here is what I get:

database entries screenshot

The systemDateTime represents when the cron job executes. As you can see, it only executed 6 times and it started about 6 minutes before the scheduled time.

Is this system configuration related? The cron job is on a Apache shared server. Am I missing something or what?

Update: I use the following PHP code to get the system date time and my timezone date time:

$systemDateTime = date('Y-m-d H:i:s');
$dateNow = new DateTime("now", new DateTimeZone('GMT+2'));
$zoneDateTime = $dateNow->format('Y-m-d H:i:s');  
I added the php code how I got the different time
Source Link

Consider the following cron job:

* 22-23 * * * /usr/bin/curl -u username:paswword http://api.example.com/api/test2.php

Now, according to this, the cron job must run every minute starting from 22h00 (UTC) but it doesn't. It starts before that time and also not for the full hour. So I wrote the execution time to a database table, just to see what's going on. Here is what I get:

database entries screenshot

The systemDateTime represents when the cron job executes. As you can see, it only executed 6 times and it started about 6 minutes before the scheduled time.

Is this system configuration related? The cron job is on a Apache shared server. Am I missing something or what?

UPDATE I use the following php code to get the system date time and my timezone date time:

$systemDateTime = date('Y-m-d H:i:s');
$dateNow = new DateTime("now", new DateTimeZone('GMT+2'));
$zoneDateTime = $dateNow->format('Y-m-d H:i:s');  

Consider the following cron job:

* 22-23 * * * /usr/bin/curl -u username:paswword http://api.example.com/api/test2.php

Now, according to this, the cron job must run every minute starting from 22h00 (UTC) but it doesn't. It starts before that time and also not for the full hour. So I wrote the execution time to a database table, just to see what's going on. Here is what I get:

database entries screenshot

The systemDateTime represents when the cron job executes. As you can see, it only executed 6 times and it started about 6 minutes before the scheduled time.

Is this system configuration related? The cron job is on a Apache shared server. Am I missing something or what?

Consider the following cron job:

* 22-23 * * * /usr/bin/curl -u username:paswword http://api.example.com/api/test2.php

Now, according to this, the cron job must run every minute starting from 22h00 (UTC) but it doesn't. It starts before that time and also not for the full hour. So I wrote the execution time to a database table, just to see what's going on. Here is what I get:

database entries screenshot

The systemDateTime represents when the cron job executes. As you can see, it only executed 6 times and it started about 6 minutes before the scheduled time.

Is this system configuration related? The cron job is on a Apache shared server. Am I missing something or what?

UPDATE I use the following php code to get the system date time and my timezone date time:

$systemDateTime = date('Y-m-d H:i:s');
$dateNow = new DateTime("now", new DateTimeZone('GMT+2'));
$zoneDateTime = $dateNow->format('Y-m-d H:i:s');  
Copy edits.
Source Link
Giacomo1968
  • 56.1k
  • 23
  • 167
  • 214

Consider the following cron job:

*   22-23   *   *   *   /usr/bin/curl -u username:paswword http://api.example.com/api/test2.php

Now, according to this, the cron job must run every minute starting from 22h00 (UTC) but it doesn't. IIt starts before that time and also not for the full hour. So I wrote the execution time to a database table, just to see what's going on. Here is what I get:
  

database entries screenshotdatabase entries screenshot

The systemDateTimesystemDateTime represents when the cron job executes. As you can see, it only executed 6 times and it started about 6 minutes before the scheduled time.

Is this system configuration related? The cron job is on a apacheApache shared server. Am I missing something or what?

Consider the following cron job:

*   22-23   *   *   *   /usr/bin/curl -u username:paswword http://api.example.com/api/test2.php

Now, according to this, the cron job must run every minute starting from 22h00 (UTC) but it doesn't. I starts before that time and also not for the full hour. So I wrote the execution time to a database table, just to see what's going on. Here is what I get:
 database entries screenshot

The systemDateTime represents when the cron job executes. As you can see, it only executed 6 times and it started about 6 minutes before the scheduled time.

Is this system configuration related? The cron job is on a apache shared server. Am I missing something or what?

Consider the following cron job:

* 22-23 * * * /usr/bin/curl -u username:paswword http://api.example.com/api/test2.php

Now, according to this, the cron job must run every minute starting from 22h00 (UTC) but it doesn't. It starts before that time and also not for the full hour. So I wrote the execution time to a database table, just to see what's going on. Here is what I get: 

database entries screenshot

The systemDateTime represents when the cron job executes. As you can see, it only executed 6 times and it started about 6 minutes before the scheduled time.

Is this system configuration related? The cron job is on a Apache shared server. Am I missing something or what?

corrected typos
Source Link
Loading
added one more tag to be more specific
Link
Loading
Source Link
Loading