Setup a server cronjob in a GridPane server

The logic here is really simple, we need to create a more stable cronjob system than the GridPane’s or WordPress default, because if the site isn’t a high traffic site we are probably face the issue that the cronjob will not run. In order to avoid this we have to setup server cronjobs that are working always to prevent errors.

Login to the server

Login to your server via SSH

Find the crons for website user

Execute the following command to see your crontab jobs

crontab -e -u {{linux_site_user}}

replace the {{linux_site_user}} with your current site user e.g kala21. If you don’t know the current site user please go to our spreadsheet and find the right server to see your site user under the FTP column

Make the cron to work

Write the following command (you can change the number with whatever you want) recommended value is something small in order to ensure that everything is running smoothly.

*/5 * * * * cd /var/www/yourdomain.com/htdocs;/usr/local/bin/wp cron event run --due-now >/dev/null 2>&1

Just replace the 5 with your desired number of minutes. If you don’t know what is cron sheduling please read more on this article. Also you have to replace the yourdomain.com with the actual domain of your site.