Availability, defined as the fraction of time a network service is operative, is a key network service parameter. Dedicated protection increases availability but also the cost. Shared protection instead decreases the cost, but also the availability. In this article, we formulate and solve an integer linear programming (ILP) model for the problem of minimizing the backup resources required by a shared-protected static optical network whilst guaranteeing an availability target per connection. The main research challenge is dealing with the nonlinear expression for the availability constraint. Taking the working/backup routes and the availability requirements as input data, the ILP model identifies the set of connections sharing backup resources in any given network link. We also propose a greedy heuristic to solve large instances in much shorter time than the ILP model with low levels of relative error (2.49% average error in the instances studied) and modify the ILP model to evaluate the impact of wavelength conversion. Results show that considering availability requirements can lead up to 56.4% higher backup resource requirements than not considering them at all, highlighting the importance of availability requirements in budget estimation.