I think you're thinking of the cockpit voice recorder [0], the flight data recorder [1] (also referred to as the black box) contains all sorts of data about what commands were sent to plane and, Wikipedia says, records "17–25 hours worth of data in a continuous loop" (presumably overwriting the oldest data once it's reached capacity).
[0] https://en.wikipedia.org/wiki/Cockpit_voice_recorder
[1] https://en.wikipedia.org/wiki/Flight_Data_Recorder
edit: just about everyone's beat me to it!