I am trying to make an script that will every second read string from a file, and execute it.
executer.pyc:
import os, time
f = open("/root/codename/execute","a")
f.write("")
f.close()
cmd=open('/root/codename/execute', 'r').read()
if not cmd=="":
os.system(cmd)
os.system("rm /root/codename/execute")
time.sleep(1)
os.system("python executer.pyc")
Problem is, that it constantly f's up whole ps -aux and other similiar commands. How can i make, that it will kill itself and then launch itself again? My idea, is a parent script that will launch executer.pyc everytime that script closes itself. But how can i make it, that it will not have effect like executer.pyc? I know this whole system how it works is kinda bad, but i just need it this way (reading from file "execute"). Please help!
Thanks in advance!