Minor Issue in clearBackup function
the clearBackups() function get called after web backup and after db backup with the backup_copies value from web_domain and web_database.
There is no problem if the backup_copies in web_domain and web_database is the same (that's standard) But if backup_copies form web_domain and web_database is different the the clearBackups delete all backups to the lower backup_copies value.