If your cron job encounters timeout errors, there are 2 possible causes:
Edit your global (/etc/nginx/nginx.conf) or website-specific (/etc/nginx/sites-enabled/example.com.conf) Nginx configuration, change the fastcgi_read_timeout line to
fastcgi_read_timeout 1800;
If fastcgi_read_timeout doesn't exist, add it inside a http{..} section like:
http { fastcgi_read_timeout 1800; }
1800 is the maximum allowed execution time (in seconds) of your cron job, change it to any value you want.
Reload Nginx to make the changes take effect:
sudo service nginx reload
or in Ubuntu:
sudo systemctl reload nginx
Change TimeOut seting in your httpd.conf (in server config or vhost config) to
TimeOut 1800
1800 is the maximum allowed execution time (in seconds) of your cron job, change it to any value you want.
Reload Nginx to make the changes take effect:
sudo service apache2 reload
or in Ubutun:
sudo systemctl reload apache2
Edit PHP configuration file (some possible locations "/etc/php/VERSION/fpm/php.ini", "/home/username/etc/phpX/php.ini", etc.), change
max_execution_time = 30
to
max_execution_time = 1800
Reload your php-fpm if necessary:
sudo systemctl reload phpVERSION-fpm
For example, if you're using php 7.2, the command would be:
sudo systemctl reload php7.2-fpm
If you're using a shared hosting, please ask the hosting technician to do the setting updates for you.
Feel free to contact us if you need any further assistance.