-1

How can I write a script which should run at every 3 hours?

I do not want to use crontab.

Anthon
  • 69,918
  • 32
  • 186
  • 246

1 Answers1

0

You need deamon exemplified in How to make Python script run as service? and make changes

import time 
class MyDaemon(Daemon):
    def run(self):

        while True:
            time.sleep(60 * 60 * 3)  # Delay for 1 hour in seconds
            print "3 hours pass."
Community
  • 1
  • 1
Jones
  • 1,480
  • 19
  • 34