enupal / backup

Fully integrated Backup solution for Craft CMS
https://enupal.com/craft-plugins/enupal-backup
Other
16 stars 3 forks source link

Scheduler Config providing server path instead of URL #38

Closed adrianjean closed 2 years ago

adrianjean commented 2 years ago

Description

When visiting the Enupal Backup (EB) Settings for Scheduling, the example cron job provided uses a server path instead of a webhook url. When testing the curl command, it errors out. But changing the curl path to a public URL allows the backup job to queue properly.

Problem

When I visit:

https://website.ca/admin/enupal-backup/settings/schedule

The cron job example provided looks like this:

# Enupal Backup Webhook
10     3    *    *    *  curl --request GET '/svr/www/website.ca/web/enupal-backup/schedule?key=sldhj4ksuidh'
11     3    *    *    *  cd /svr/www/website.ca && php craft queue/run

However running that curl command errors out: curl: (3) <url> malformed

The solution

To solve this I have to change the URL path in the cronjob to a publicly accessible URL like this:

# Enupal Backup Webhook
10     3    *    *    *  curl --request GET 'https://website.ca/enupal-backup/schedule?key=sldhj4ksuidh'
11     3    *    *    *  cd /svr/www/website.ca && php craft queue/run

Not sure if this is a problem with my config of EB, or something EB is doing instead of showing the site URL in the cronjob example.

Additional info

adrianjean commented 2 years ago

and....I just found the problem and solution.

Make sure that your Base URL for your site is set correctly under:

https://website.ca/admin/settings/sites

I had @webroot which was providing a server path and not a public URL. It should have been @web or a valid base URL like https://website.ca