I have run into a problem while writing my server program. I need to set a timeout for a socket that will increase every single day depending on when the socket checks in. The program will +1 to a variable that represents the dates passed since when the server is first run. This variable will than be multiplied by 86,400 (The amount of seconds in a day) to set the timeout for the socket.
My question is, is there a way to run a cron job that will execute a part of a script every say, 2 days? The server in question has commands that can run this. However, that would involve manual interaction which is a pain. So, in python is there a way to make it run a command every day at 4:00 am, without locking the program up with a while loop?
You need to create a seperate thread of execution for your socket communication to be handled in.
http://www.devshed.com/c/a/Python/Basic-Threading-in-Python/