11/06/2016

Python :: python save log to from crontab

Python :: python save log to from crontab

  1. import time
  2. print ("Run relay.py " + time.strftime("%x") + " " + time.strftime("%X"))
  3.  


Out put :: date time
Run relay.py 06/20/16 15:58:10
Run relay.py 06/20/16 15:59:11
  1. crontab -e
  1. 0 0 * * 1-6 python /home/pi/relay.py >> /home/pi/relay.log 2>&1

No comments:

Post a Comment