I have warm-cache premium plugin, I can run it fine from command line with the below commands:
cd /home/USER/public_html
bin/plugin warm-cache warm https://example.com/sitemap.json
or
/home/user/public_html/bin/plugin warm-cache warm https://example.com/sitemap.json
both esentially the same thing. However, when I save this as a shell script as per the docs, in root/bin:
#!/bin/sh
cd /home/USER/public_html
bin/plugin warm-cache warm https://example.com/sitemap.json
I get the following error when run with cron:
2024-06-15T08:23:02+01:00
Content-type: text/html; charset=UTF-8
FATAL: Must be run from ROOT directory of Grav
Aside from the above Ive tried
cd …
cd “/…/”
.bin/plugin warm-cache warm https://example.com/sitemap.json
cd /home/USER/public_html
cd “/home/USER/public_html/”
I cant see what Im missing?
The alternative is “if onCacheClear Event” is enabled in the plugin settings does this still trigger from the cache-clear cron job? If so I dont need any of the above as this is set up and working.