Scheduled Backups Not Working

Although I was able to successfully set-up the Grav Scheduler as well as enable the default-site-backup, the scheduled backup is not created.

(I am able to manually create a backup using bin/grav backup.)

Any sense of where I should start to troubleshoot?

Have you enabled this?

Thank you.

It was not enabled, but even after I enabled it and adjusted the Run Scheduled Job to run in the near future, no backup was created.

maybe you did not register the grav scheduler in your cron service ?
see the docs

Have you include change directory command in your cron job? Because it need to be at the Grav root directory for bin/grav to work.

Otherwise I would suggest you check the cron output for any errors.

I think it is registered, as I get the following:

$ bin/grav scheduler -i

Install Scheduler
=================                                                                                                                        
[OK] All Ready! You have already set up Grav's Scheduler in your crontab

Change directory command is included (per the install instructions).

bin/grav scheduler -d returns no errors.

However, bin/grav scheduler -j confirms the default-site-backup has never run.

Thank you!

:thinking: how about crontab -l to double check if it is there?

Here is the output of crontab -l

MAILTO=myemail@email.com * * * * * cd /home/example/folder;/usr/local/php72/bin/php bin/grav scheduler 1>> /dev/null 2>&1

:thinking: what if you run the scheduler manually with bin/grav scheduler -v, does it run?

It returns:

Running Scheduled Jobs

======================

Should it return more (like a list of jobs running)?

I was able to fix this by using DreamHost’s GUI for cron jobs.

I entered this command to run:
cd /path/to/my/site;/usr/local/php72/bin/php bin/grav scheduler

Thank you for all the help!

1 Like