Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Help with scheduler (warm-cache)

plugins

Started by Graham 2 years ago · 1 replies · 498 views
2 years ago

I have warm-cache premium plugin, I can run it fine from command line with the below commands:

BASH
cd /home/USER/public_html
bin/plugin warm-cache warm https://example.com/sitemap.json

or

TXT
/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:

BASH
#!/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:

YAML
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.

Suggested topics

Topic Participants Replies Views Activity
General · by lynbor, 3 weeks ago
3 352 3 days ago
General · by lynbor, 1 week ago
7 386 3 days ago
General · by Harry, 3 days ago
0 83 3 days ago
General · by Old Man Umby, 3 weeks ago
2 256 2 weeks ago
General · by jeremycherfas, 3 weeks ago
5 374 2 weeks ago