linux – php script run in different behiber via crontab-ThrowExceptions

Exception or error:

I have installed a phpIPAM server to manage IPs.
The server has a PHP script to discover new computers on the network.

I write a line in the /etc/crontab in order to run the script every 6 hours.
When the script runs the Memory and CPU (4CPU 8MEM CentOS 7) overload and the DB getting crash.

When I execute the script via the CLI the script runs but not taking all the CPU and MEM.

this the line from crontab
* 0,6,12,18 * * * root /bin/php /var/www/html/functions/scripts/discoveryCheck.php > /dev/null 2>&1

via cli I execute like this (logged in with root)
/bin/php /var/www/html/functions/scripts/discoveryCheck.php > /dev/null 2>&1

top when running from crontab

top when running manually

is there any difference using crontab than ‘manual’ run of the script?

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *