Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Help with scheduler (warm-cache)

plugins

Started by Graham 2 years ago · 1 replies · 451 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 jeremycherfas, 4 days ago
2 86 15 hours ago
General · by Old Man Umby, 2 days ago
1 60 2 days ago
General · by Sebastian, 4 days ago
1 81 4 days ago
General · by Andy Miller, 2 weeks ago
0 215 2 weeks ago
General · by ready-4-IT, 6 months ago
1 716 3 weeks ago