Wednesday, 8 May 2013

Time Lapse Videos of the Garden (3 of 3)

This is the last video in this time lapse series.

In this video I've removed all the images taken between 8pm and 5am. Don't worry, I didn't have to do this by hand! All the videos save with a similar file name which has the date and time in it so I wrote a little regular expression that deleted all the files with a 00 - 04 or a 20 - 23 in the hour slot. The commands looked like this:

rm 00A8F9005FCC\(IPCamera\)_0_2013????0{0..4}*
rm 00A8F9005FCC\(IPCamera\)_0_2013????{20..23}*

The rm command you should be familiar with, then it is the camera's MAC address (I think) followed by the name in brackets then _0_ (for some reason, maybe camera number) then the 4 digit year, 2 digit month (single digit wildcards), 2 digit date (single digit wildcards) then the 2 digit hour. Notice in the first command I put the first digit of the hour outside the curly bracket, I just wasn't sure 00..04 would work so opted for 0..4 instead. What came after the hour digits didn't matter so I just dropped in a multi digit wildcard.