Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Help with scheduler (warm-cache)

plugins

Started by Graham 2 years ago · 1 replies · 155 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 Jerry Hunt, 4 days ago
2 74 7 hours ago
General · by pamtbaau, 12 hours ago
1 47 12 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 39 5 days ago