Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Linux by (18.4k points)

I have my cron job set up for the daily execution like so:

0 0 * * * /path/exec.sh


It is set for daily execution. I usually open my machine at 8 a.m. I would want to find out

- At what time my cron job was in process?

- I also want to know if any of my cron jobs are running at this moment?

Is there any way to find out IF my cron job is running at this moment?

1 Answer

0 votes
by (36.8k points)

To check if your cron is running anything at this moment in time 

pstree -ap `pidof cron`

and you'll either get

2775,cron # your pid (2775) will be different to mine 

or a tree output with the child processes which cron is running. Also, as Hamoriz says, the logs should be in /var/log/syslog. Then, the below:

grep CRON /var/log/syslog

will provide you the logs just for cron

To know about Linux join the Linux training

Related questions

0 votes
0 answers
0 votes
1 answer
asked Dec 5, 2020 in Linux by blackindya (18.4k points)
0 votes
1 answer
asked Nov 22, 2020 in Linux by blackindya (18.4k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...