panel
panel copied to clipboard
Add option to set maximum frequency of Schedules
Is your feature request related to a problem? Please describe. Some crafty customers have decided to create a schedule that runs */20 minutes to create backups. Luckily they fail so often that the damage they did to SSDs was limited.
Describe the solution you'd like Have an option to either restrict the ability to put * for minute and hour for cron jobs or some other method to set the maximum frequency that a schedule can occur
Describe alternatives you've considered Running daily queries to catch anyone who does this and send stern emails, but this is inconvenient.
Additional context My poor SSDs getting wrecked! :(
You can configure throttles for I/O of backups, together with the number of backups that someone can create in a specific period of time by adding those variables into your .env file.
... number of backups that someone can create in a specific period of time by adding those variables into your .env file.
This would probably work best for you. As you could limit all the servers to X backups in an X time period.
So you could do 1 backup every 1 hour. So you would add the below to the .env
BACKUP_THROTTLE_LIMIT=1
BACKUP_THROTTLE_PERIOD=3600
Does this display a message in the Schedules that this is set or will it just fail the jobs if it runs to regularly?
Does this display a message in the Schedules that this is set or will it just fail the jobs if it runs to regularly?
It will provide a warning informing that only X backups can be created within Y seconds when trying to create a backup manually. Automated schedules will fail and skip the backup creation with the error being logged in the database table failed_jobs
.
The backup frequency limits are not shown in the schedules and the default limits are 2 backups within 10 minutes. You can customize the I/O throttles together with the frequency of backups to match your requirements.
I think combined with those settings we could also add a throttle for maximum speed schedules can run at, so you can say no schedules that run more than once every X minutes?
That would be great yeah, with a message that shows the end user if they try to exceed it when attempting to create the schedule. Having a cron.guru style thing would be really neat as well if possible.
Edit: Main thing is to provide visual feedback to someone trying to create it so they can see what is valid and what isn't