I have a python script that runs fine when I run it via python3 script.py &
on the the google vm, but then when i detach it with a screen
and leave it run a couple iterations on its own I come back to check and it gets killed.
I think it might be something to do with high cpu usage, i tried to do a while true loop and sleep the program for a while, then i tried to use apscheduler
or just scheduler
or even nice -n 19 python3 script.py
but neither worked out, the thing is that the script seems to run fine the first time or even first two times, but then it gets killed.
Here is how I run my script, is there anyway i can solve this without upping my CPU? I think I have a small machine on vm.
schedule.every(10).minute.do(scheduled_job)
print('STARTED PROGRAM')
while True:
schedule.run_pending()
time.sleep(1)