0

The following command is executed at system startup and the PHP script is running in the background continuously with a loop:

screen -dmS some-friendly-name php /path/to/file.php

Unfortunately, I accidentally deleted /path/to/file.php file. But when I reattach to the screen session, I can see the script is still running (giving output).

Is there a way to recover this file, other than the standard file recovery processes? Could it be stored in a PHP buffer etc?

countermode
  • 7,533
  • 5
  • 31
  • 58

1 Answers1

0

You can still see the PHP process running because it has become a process: a program in execution that already loaded the code.
Even if that code is deleted, if the process is in execution, it will have no consequences on the running process, that already uses its own loaded copy of the code.

For the data recovery take a look at one of the tools linked here: File Recovery

Echoes_86
  • 752