简体   繁体   中英

El Capitan: CRON Job is unable to trigger a shell script

*/10 * * * * /bin/sh /dataScience/dat/JOB/forker.sh

Above is the cron job which does not execute. I have checked separately both the functioning of cron job and shell script which works fine. Even the below command works well.

/bin/sh /dataScience/dat/JOB/forker.sh

I have also checked the permissions of forker.sh which shows

-rwxr-xr-x  1 mango  wheel   442 Nov 20 12:53 forker.sh

Am i missing something which restricts the cron job from triggering the script?

Generally the syntax for the job goes like:

minute hour dom month dow user cmd

In your case, the job might be for multiple user, it seems

*/10 * * * * /bin/sh /dataScience/dat/JOB/forker.sh

Which implies it should be run at the interval of 10 mins all the time. Which is not problematic.

Can you tell us if the following is giving you the output at all?

*/10 * * * * (echo "Printing."; echo "Logging." > /dataScience/dat/JOB/abc.txt | mail -s "Mailing" your_email)

Note: I wanted to comment this, since this is not exactly the answer but debugging, but I have reputation lesser than 50, hence couldn't comment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM