Solved Crontab in Wordpress (managed) app
-
I know there's wp_cron in the Wordpress app but can we have cron/crontab too?
-
Wordpress uses the Cloudron cron addon to spin up cron tasks in a separate container, the schedule for this is every 5 minutes.
Basically what it calls is
exec /usr/local/bin/gosu www-data:www-data /app/code/wp cron event run --due-now
-
So can I use that to schedule regular shell commands?
-
There's a bunch of plugins like WP Crontrol, Advanced cron, Simple cron. You can use them to setup a custom pattern and call a custom function. Your PHP function can just shell exec your script (or maybe you can even write PHP depending on your use case).