Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Cron Backups via Admin Panel: Resulting in Backups every minute #3841

Open
chraebsli opened this issue Jun 24, 2024 · 3 comments

Comments

@chraebsli
Copy link

After I added Backup profiles with automated job execution enabled, I got an enormous number of backups today.

Description

Last week, I added automated backups to my existing backup profiles. I did this on my production server directly, since I wanted to see if it worked over the weekend since I had to do some editing to cron execution on the server (managed).

My two backup profiles:

  • data backup (/user dir without plugins/ themes), set to 'Every day at 00'
  • system backup (complete grav backup (default), set to 'Every week on Monday at 00'

This morning I was a bit confused since I had more than 100 backups. After checking the user/config/backups.yaml file, I noticed that there was a misconfiguration:

  • 'Every day at 00' matches * 0 * * * in Grav, but should be 0 0 * * *
  • 'Every week on Monday at 00' matches * 0 * * 1 in Grav but should be 0 0 * * 1

Because of that, Grav did a backup every day at 00:00 AND every minute past that hour, resulting in 60 backups per day instead of one.

Resolution

Please fix this issue by adding a minute field or replace the cron field with a text field like in the scheduler. I'd prefer the text field, although I really like how simple the cron field is for not experienced users.
But I could do some fancy stuff like 0 */6 * * * which isn't possible with the cron field and it will render as an error in the admin panel.

@chraebsli
Copy link
Author

chraebsli commented Jun 24, 2024

I just tried and checked if this only was an issue with backups but it seems it is a bigger problem.

All settings in themes, plugins, and configs depending on this cron type field are affected. In my setup, these are the ones:

  • scheduled caching settings in system.yaml config
  • scheduled backups profiles in backups.yaml config
  • re-indexing of TNT Search Plugin.

Every of this and probably more fields saved via admin panel which aren't looked at from the file have this misconfiguration.

@pamtbaau
Copy link
Contributor

It seems to be a problem caused by the jqCron utility in cron-ui.js provided by Admin. The incorrect schedule (missing minute 0) is already incorrect when received by the server.

Since it is an Admin issue and not a server issue, you could use the following workaround:

  • Edit user/config/backup.yaml locally and move it to the server using ftp, or scp.
  • Or edit user/config/backup.yaml remotely using ssh.

@chraebsli
Copy link
Author

I only rarely use the admin panel for configuration, so for me, it's not a big problem. But I created this issue to let the Grav team & community know that this problem exists.

There surely are users who only work with the admin panel and don't know anything about cron, at latest when it comes to a client who thinks he knows he does.

Since this is an admin issue, could anyone from the Grav team transfer this issue to the admin plugins? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants