I’m on a Mac and need a cronjob for a WordPress plugin. How do I set up the cronjob?
I think I’ve got this sorted out. Since I couldn’t find any documentation for this, I thought I’d offer some:
Secret #1 - Right-clicking on the name of the site in the Local Sites lists brings up a menu that includes Open Site Shell. This provides access to the Mac CLI with appropriate environmental variables in place to work with the current site.
Secret #2 (optional) - Local > Preferences > Appearance & Behavior > Default Apps lets you choose your preferred terminal app. On the Mac, the choices are Terminal, iTerm and Hyper. The latter two will be available if they are in the Applications folder (or ~ Applications).
Secret #3 - wp-cli is pre-installed in Local and can be accessed in a crontab at /Applications/Local.app/Contents/Resources/extraResources/bin/wp-cli/bin/wp
With these secrets revealed, I used Open Site Shell and then updated my crontab file as I normally would.
I hope this helps and please improve on this documentation if need be.
Thank you very much. This was very helpful!
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.