Cron tab query

Hi
In my Unix server more than 500 cron jobs are scheduled daily and weekly basics.

Now,I would like to know only list of JOBs,which are running only on 14th of every month?

How can i find only which are all jobs will be scheduled only on 14th.

Please tell me the script.

Koti, Can you try this?

crontab -l | awk -F" " '{ if($3=="14") print $0 } '

using grep we can extract the only matching 14th date only for every month

Example:

crontab -l | grep "14"

you can try with grep also.

That's insufficient. What if the job runs on the 14th minute of the hour, or the 14th hour of the day. Also, if a job runs on the 14th and 15th day and not only on the 14th? All of those situations will trigger false positives.

Although it may be less clear to the uninitiated, you can shorten that to:

awk '$3=="14"'

However, i think the month needs to be checked as well, since only jobs that run every month are of interest:

awk '$3=="14" && $4=="*"'

If you want to be truly insane, the month field should be checked for alternatives to "*" which are equally valid ways of expressing "every month", such as "1-12" or "1,2,3,4,5,6,7,8,9,10,11,12" or "1,2,3,4-12" or "1-11,12" or .... --> that way lies madness :wink:

Cheers,
Alister

How about this ?

crontab -l |grep "\w \w 14"