Dimentica
Dimentica

Reputation: 805

Deleted process continues creating a file

In my website I had a process which needs to create a file (executed with cronjob). However, I removed both the script and the cronjob, but the file is still created and the process from the cronjob executed. I know this sounds really unbelievable, but is there any way a process can stack in the memory of the server and loop? Can you think of any other reason causing this problem?

Upvotes: 0

Views: 29

Answers (1)

Justinas
Justinas

Reputation: 43507

I had same issue. Process is executed infinity times and code changes, code removal does not help as it seems that process is "caching" your code.

What I have done:

Log in to SSH to server, use top command and search for PHP process PID, than use kill to terminate this process. (some source about it).


To prevent this:

I have created some file on server and inside every loop and just before starting function (I had recursive function) check if file exists (or check for valid content). If not found - do not execute process.

Upvotes: 1

Related Questions