title: Stream MJPEG to file, but keep only last x minutes
body: <p>I'm looking to record a MJPEG stream on motion detected. But my motion detection notification is seconds later than the motion occurs. </p>
  
  <p>To counter this, I want to record all the time, but only keep the last 2 minutes of footage. </p>
  
  <p>Right now I'm downloading infinitely with cURL, but I'm stuck on how to have it trim the front of the file correctly to be 2 minutes. </p>