The calls to nginx and service in the wordpress.cron cronjob fail because the default bash shell's environment variables are not accessible to cronjob.
This is because cron doesn't use /bin/bash but /bin/sh which links to /bin/dash on Ubuntu.
The call to letsencrypt/certbot script in the same cronjob file succeeds because it is on the path known by /bin/sh.
The fix is to use absolute path for nginx and service, i.e: /usr/sbin/nginx and /usr/sbin/service.
The calls to
nginx
andservice
in the wordpress.cron cronjob fail because the default bash shell's environment variables are not accessible to cronjob. This is because cron doesn't use/bin/bash
but/bin/sh
which links to/bin/dash
on Ubuntu.The call to letsencrypt/certbot script in the same cronjob file succeeds because it is on the path known by
/bin/sh
.The fix is to use absolute path for
nginx
andservice
, i.e:/usr/sbin/nginx
and/usr/sbin/service
.