> (you don't have to strictly follow this form)

**Use case**

Sometimes, for really sophisticated scenarios it can be hard to control the amount of in-progress backups run externally. For the purpose of simpler control we can introduce server-level setting which disallows running concurrent backups of any type. 

Something like this in `config.xml` (enabled by default):
`<allow_concurrent_backups>true</allow_concurrent_backups>`

**Describe the solution you'd like**

It's important that backups can be executed in distributed way on multiple servers. Need to take it into account.

**Describe alternatives you've considered**
External check of `system.backups` table, but it can be complex.

{
    std::lock_guard lock{infos_mutex};
    auto it = infos.find(id);
    if (it == infos.end())
        throw Exception(ErrorCodes::LOGICAL_ERROR, "Unknown backup ID {}", id);
    return it->second;
}
std::vector<BackupsWorker::Info> BackupsWorker::getAllInfos() const
{
    std::vector<Info> res_infos;
    std::lock_guard lock{infos_mutex};
    for (const auto & info : infos | boost::adaptors::map_values)
    {
        if (!info.internal)
            res_infos.push_back(info);
    }
    return res_infos;
}
void BackupsWorker::shutdown()
{
    bool has_active_backups_and_restores = (num_active_backups || num_active_restores);
    if (has_active_backups_and_restores)
        LOG_INFO(log, "Waiting for {} backups and {} restores to be finished", num_active_backups, num_active_restores);
    backups_thread_pool.wait();
    restores_thread_pool.wait();
    if (has_active_backups_and_restores)
        LOG_INFO(log, "All backup and restore tasks have finished");
}
}