title: R Check of for loop is still running
body: <p>I have a loop that collects data from a website every minute (while(TRUE){ xyz }). It is crucial to me that that process is running continuous. I was wondering if there is a way to check if the loop is still running? Also, when it has stopped running, I'd like an email/sms. </p>
  
  <p>What I can do is write <code>Sys.time()</code> at the end of each loop to a file, which then can be picked up with the other independent <code>R</code> script (ran on a different machine), which compares the timestamp with the current time. If the timestamp is >3 minutes old, it means the last 2 loops were not performed, and sends the email/sms.</p>
  
  <p>Would this be the easiest way? Or am I missing something?</p>