1

I have a data server recording data every second. i need to setup a cron job that that runs a script that can give a reply if the now() is 24 hours more than the last data recorded.

So that I can link this to a email alert for recording failure. CAn someone help me? I am new to PostgreSQL and linux, too.

My table provides data as

 sensorid |           t         | unscaled_val | scaled_val 
----------+---------------------+--------------+------------- 
       46 | 2014-06-06 11:52:47 | 0.008975     | 345.386645 
       32 | 2014-06-06 11:52:47 | 0.01202      | 1503.755853 
       45 | 2014-06-06 11:52:47 | 0.004        | 50.019719 
       31 | 2014-06-06 11:52:47 | 0.013687     | 60.541131 
       18 | 2014-06-06 11:52:47 | 0.012655     | 57.372001 
       34 | 2014-06-06 11:52:47 | 0.004025     | 4.671827 
       37 | 2014-06-06 11:52:47 | 0.004147     | 4.604936
  • You will need to show your table definitions and some sample data if you want help writing a command. – Craig Ringer Jun 6 '14 at 0:52
  • My table provides data as sensorid | t | unscaled_val | scaled_val ----------+---------------------+--------------+------------- 46 | 2014-06-06 11:52:47 | 0.008975 | 345.386645 32 | 2014-06-06 11:52:47 | 0.01202 | 1503.755853 45 | 2014-06-06 11:52:47 | 0.004 | 50.019719 31 | 2014-06-06 11:52:47 | 0.013687 | 60.541131 18 | 2014-06-06 11:52:47 | 0.012655 | 57.372001 34 | 2014-06-06 11:52:47 | 0.004025 | 4.671827 37 | 2014-06-06 11:52:47 | 0.004147 | 4.604936 – rajeevkamal Jun 6 '14 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.