Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why my cron job executing multiple times?

I have set up a cron job that need to be executed once a day but it is getting executed multiple times.I have set up it as I mentioned below:

5 8 * * * /sh_file_path

Can anyone please tell me why is this happening and what should I do to resolve this problem.

like image 390
Neha Mangla Avatar asked Oct 01 '22 15:10

Neha Mangla


1 Answers

Without more knowledge about your particular setup/system, and the fact that all jobs get executed multiple times, I can only surmise that you have multiple cron daemons running on your system.

Do a full process list and grep for cron (most of them have that word in the name of the binary) and see how many are running. On a standard linux system, this should work:

ps aux | grep cron

Then you would have to figure out which should be running and kill the others.

like image 141
fredrik Avatar answered Oct 05 '22 10:10

fredrik