Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

i have a cron job center code hereonfigured at var/spool/cron/testuser, Am calling "adindex.sh" file from there.

Am getting results when am directly put the command directly in prompt(php and sh), But cron is not processing this one. I tried to log the cron using tail -f /var/log/cron and got:

Feb 19 04:05:01 ip-118-139-177-76 CROND[18164]: (inwhosting) CMD (/home/testuser/cronlogs/adindex.sh)

Edit: Output for crontab -l

MAILTO=""
*/5     *       *       *       *       /home/testuser/cronlogs/adindex.sh
*/5     *       *       *       *       /home/testuser/cronlogs/sendemail.sh
*/5     *       *       *       *       /home/testuser/cronlogs/sendsms.sh

Ouput of cat /home/testuser/cronlogs/adindex.sh

#wget --user=admin--password=pswd123 http://www.exmaple.com/advertiser/cron/updateindex?cron_key=Inw1234 -O /home/testuser/cronlogs/ad/log_`date "+%Y_%m_%d_%H_%M"`.txt

php /var/www/html/exmaple/cron/advt_index.php
php /var/www/html/exmaple/cron/ad_index.php

Anybody please tell me what is going wrong?

share|improve this question

closed as off-topic by jasonwryan, Anthon, Timo, Zelda, slm Feb 20 at 12:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – jasonwryan, Anthon, Timo, Zelda, slm
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
There's a typo somewhere in your question is adindex.sh a php script or a shell script. your log shows cron is attempting to execute your command, what does your command look like why do you think it isn't running ? –  X Tian Feb 19 at 11:31
    
My cron job is to index the solr database, and it is not indexing via cron job. I tried this via command line and works fine –  Ammu Feb 19 at 11:52
    
what is the name of your script ? is it a php script or shell script ? –  Kiwy Feb 19 at 12:18
1  
can you edit your question to add the result of cron -l –  Kiwy Feb 19 at 12:58
2  
Is php in cron's $PATH? –  Hauke Laging Feb 19 at 14:19

2 Answers 2

ammu you have to execute it using sh here is my example

MAILTO=user@linuxmental.com
30 11 * * * sh /home/user/backup.sh
30 17 * * * sh /home/user/backup.sh

have a look here cronjob

share|improve this answer
    
Or chmod a+x /home/user/backup.sh (assuming it has a shebang). –  Patrick Feb 20 at 6:07

Fixed this issue. It was a permission issue of calling sh files from cron.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.