CVRs and FDRs write continuously, as long as an engine is running. (Usually the oil pressure switches turn the system on and off). Starting from a clean recording medium (newer recorders are mostly solid state - SSFDR and SSCVR) they write until the storage medium is full and then continue, over-writing the older data as they go. Maintenance never erase recorded data, there is no need to do so.
For most commercial operations, flight recorder data is also stored in a Quick Access Recorder (QAR) whence it is recovered post flight on a disk or PCMCIA card and the data fed into a Flight Operations Quality Assurance (FOQA) system for analysis. Engineering also acquire flight recorder data for trouble-shooting, reliability & performance analysis or to identify defects in the flight recorder system itself.
The latest SSFDRs can record 50 hours data; SSCVRs 3 hours.
CVR data can only be erased on the ground. Circuit baulks prevent operation of the bulk erase function until the air/ground sensing is in ground mode and the parking brake is set.
Note that with SSCVRs, erased data can still be recovered by accident investigators in the same way that forensic detectives can read erased data on a computer hard disk.