Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Help with scheduler (warm-cache)

plugins

Started by Graham 2 years ago · 1 replies · 643 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 Hanns Mattes, 1 week ago
0 109 1 week ago
General · by Dima, 2 weeks ago
1 131 2 weeks ago
General · by pamtbaau, 2 weeks ago
0 218 2 weeks ago
General · by lynbor, 2 months ago
5 716 4 weeks ago
General · by Andy Miller, 1 month ago
0 443 1 month ago