D
D
Danil Samodurov2021-11-18 11:10:14
Remote access
Danil Samodurov, 2021-11-18 11:10:14

Why does a Python script terminate on a remote cloud server?

Began to master remote cloud servers. Created virtual machines on AWS, Oracle and Microsoft Azure. Cloned the repository and ran the python script on each. An infinite loop script is an algorithm that pulls data from the Internet by reference, processes it and saves it to a csv file. After starting, I see that the file has been created and is being written, that is, the script is working. However, if I log in after a few hours, the recording to the file stops, but the logs are empty. This happens on all machines. The data is small, a few kilobytes, that is, I hardly spend the traffic limit. Why does the script terminate?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-11-22
@samodurOFF

When you disconnect from the VPS, the session ends. To prevent this from happening, you can use screen or nohup

screen -S pythonscript
python3 scrypt.py

Then ctrl+A, then D. and disable
nohup:
nohup python3 scrypt.py &

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question