Running a Datalogger in different Modes

Sounds like a perfectly plausible method, although I'm not quite clear why you need a switch and a command from the terminal program. I'd have the system default to recording data to the sd card. When the terminal command arrives, stop recording and send the file, then continue recording. Perhaps I didn't quite get the requirement.