Linear motion - 50mm / 15 N
Excellent question: I had the same question a while back and concluded that solenoids aren't the way to go. They generally only have a stroke of a few millimetres, they are expensive, and they require power to hold state.

Instead, what you want is a linear actuator. There are a lot of ways to build a linear actuator.

The simplest to implement is a screw drive, of some kind. An appropriately designed screw drive should be able to support 20 N easily (that's only 2 kg-force.)



Alternately, you can drive a gear rack with a worm gear. The benefit of this approach is that the gear rack is mechanically held in place by the worm gear, which provides your required holding force of 20 N for 12 hours without requiring any power.



The cam drive is OK but you would need to use a stepper motor to provide the required holding torque.