Thank you for the hint.
Where do I store the script, and what do I name it?
The script should also have a way to output a message and a variable for cPanel to know whether it should proceed with the backup, or not.
For example, if the script outputs 0, cPanel will proceed with creating a backup. If it outputs 1, cPanel will abort the backup and display a message defined in the script, such as "backup limit exceeded. You can only store five backups. Please delete some backups before creating one."
Or, as in your sample script, it might just delete the oldest backup and proceed with creating a new one. However, if the above can be done, it would be great.
Does cPanel have a native way of executing a specific script right before performing the backup? For example, cPanel might search for a "backup_pre" script in a specific directory, and if the script exists, cPanel would execute it.
Does cPanel have any such feature?