I wish to log data from a Arduino at 50sps (binary), then copy the last n bytes every 5 minutes, following time (ex: 13:05, 13:10).
What i thought:
-Continuously save data to file A, every 5 minutes remove last n bytes from file A and copy content to file B.
But i´m a bit concerned if i will loose data when copying the content, example: if the script takes 1 second (ex) to copy the content to another file, will i loose 1 second of data? I can always check the size of the file and insert some "0" or remove some bytes just to have the correct size, but i really wish not to loose data.
Any other suggestion to accomplish what i want, is welcome!