Hi everyone,
I've got a few scripts running with crontab and I know they are actually running thanks to a log file.
The thing is, each time I type ps -ef | grep .sh
(because my scripts are .sh files) i have no results.
I read that crontab was using its own environment to execute his scripts and so I was wondering if ps command was able to detect them.
I'm a newbie to Linux environment, so I'm sorry if my question might seem obvious. Thanks
If you run ps while your script is running, then ps will report that process.
crond
is the cron process, and it belongs to root. When crond notices that it's time for your process to run, it will fork a process, change that process's user to your ID, then exec()
your script.
This process will appear in ps, if ps is run while it's active, but if the process is short-lived, you only have a short window of opportunity to glimpse it..