panel icon indicating copy to clipboard operation
panel copied to clipboard

Add option to set maximum frequency of Schedules

Open aussieserverhosts opened this issue 3 years ago • 6 comments

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! :(

aussieserverhosts avatar May 05 '21 23:05 aussieserverhosts

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.

Software-Noob avatar May 06 '21 00:05 Software-Noob

... 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

notAreYouScared avatar May 06 '21 01:05 notAreYouScared

Does this display a message in the Schedules that this is set or will it just fail the jobs if it runs to regularly?

aussieserverhosts avatar May 06 '21 08:05 aussieserverhosts

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.

Software-Noob avatar May 06 '21 13:05 Software-Noob

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?

DaneEveritt avatar May 06 '21 15:05 DaneEveritt

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

aussieserverhosts avatar May 07 '21 00:05 aussieserverhosts