Page 1 of 1

cron vs datetime script

Posted: Sun Sep 15, 2019 3:26 pm
by Bope
Once I get my leak sensor all hooked up it will be running headless so I want it to send me a message once a month just to let me know it is still running. My understanding is if I use a cron job I could set it up to run a separate python script that will send me out a text message. Does this affect the constantly running python script for my leak tester?

Alternatively I could use datetime in my python script to parse out the 1st of the month and have it send me a text. Is there any reason to do one or the other?

Re: cron vs datetime script

Posted: Sun Sep 15, 2019 4:08 pm
by trejan
If the message is to show it is running still then put it into your Python script. A cronjob will only show that the Pi is running and cron is working. The Python script could have died months ago but the cronjob wouldn't know anything about it.

Re: cron vs datetime script

Posted: Sun Sep 15, 2019 4:58 pm
by Bope
I was just having the same idea. I added it to my script.