Relative Content

Tag Archive for pythonlinuxapachecron

Determine or indicate if Linux process is started by web user (apache) or cronjob?

On my server, python scripts can be started either through a cronjob, or through our website (via apache). Sometimes I want to kill processes started by one, but not the other. When I run htop, it looks like the user is “ubuntu” for both. Is there a way to determine natively which process started the script? Or if not natively, indicate how it was started?