Quote:
Edit: you can try also to look at /var/log/maillog (if it exists). Once I had a similar problem with sendmail and the error message from the mail server was Code:
Domain of sender address user@host does not exist |
I cannot make sense of what you write.
Quote:
Quote:
Quote:
|
On Debain Etch and Ubuntu 7.10 systems in default configurations cron job logging is done to /var/log/syslog. You can find the jobs for a specific user like this:
Code:
grep CRON /var/log/syslog |grep username If you use another distro, I don't know. |
Quote:
mathew, Thanks for your patience and answers..cron is executing am getting the following mail : From oracrp@oracle.ali.com.kw Tue Dec 4 14:34:01 2007 Return-Path: <oracrp@oracle.ali.com.kw> Received: from oracle.ali.com.kw (localhost.localdomain [127.0.0.1]) by oracle.ali.com.kw (8.13.1/8.13.1) with ESMTP id lB4BY1CI005169 for <oracrp@oracle.ali.com.kw>; Tue, 4 Dec 2007 14:34:01 +0300 Received: (from oracrp@localhost) by oracle.ali.com.kw (8.13.1/8.13.1/Submit) id lB4BY1it005164; Tue, 4 Dec 2007 14:34:01 +0300 Date: Tue, 4 Dec 2007 14:34:01 +0300 Message-Id: <200712041134.lB4BY1it005164@oracle.ali.com.kw> From: root@oracle.ali.com.kw (Cron Daemon) To: oracrp@oracle.ali.com.kw Subject: Cron <oracrp@oracle> /home/oracrp/test/test.sh X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env: <HOME=/home/oracrp> X-Cron-Env: <PATH=/usr/bin:/bin> X-Cron-Env: <LOGNAME=oracrp> X-Cron-Env: <USER=oracrp> /bin/sh: /home/oracrp/test/test.sh: Permission denied You have mail in /var/spool/mail/oracrp Please guide Yusuf |
Quote:
[root@oracle etc]# cat /etc/cron.deny [root@oracle etc]# cat /etc/cron.allow ALL oracrp |
Hmm, strange. This permission denied message is the heart of the problem.
OK, please execute these commands and paste the output: Code:
ls -l /bin/bash The first is to see the permissions and location of the bash executable (which /bin/sh is a link to as determined from previous posts) I want to double check the permissions and ownership of the script file, and make sure the path is correct. I want to check the mount flags for the directory where the script is located, this time explicitly with the path seen in the email (that's the mount command) The test script is making a file in /tmp - lets be sure there is disk space free (df) In case something very weird is happening, your /tmp directory should be writable, so the last command is there just to verify this. |
Quote:
Mathew, Thanks .. here it is : [oracrp@oracle test]$ ls -l /bin/bash -rwxr-xr-x 1 root root 616248 Apr 12 2006 /bin/bash [oracrp@oracle test]$ ls -l /home/oracrp/test/test.sh -rwxr-xr-x 1 oracrp dba 47 Dec 4 15:15 /home/oracrp/test/test.sh [oracrp@oracle test]$ mount |grep $(df -k /home/oracrp/test |awk 'NR==2 { print $1 }') /dev/cciss/c0d0p1 on / type ext3 (rw) [oracrp@oracle test]$ df -k /tmp Filesystem 1K-blocks Used Available Use% Mounted on /dev/cciss/c0d0p1 25199660 7916216 16003348 34% / [oracrp@oracle test]$ ls -ld /tmp drwxrwxrwt 26 root root 4096 Dec 4 16:18 /tmp Yusuf |
I can't see anything wrong there.
What happens if you run the script using the full path (no sh at the start): Code:
/home/oracrp/test/test.sh |
Quote:
Mathew, the command works fine.... I really thank you for your patience for being with me to solve this issue all around. Yusuf |
This is really strange. The command works from the command line but you get the permission denied from cron... I am unable to understand it. I am completely out of ideas... :(
|
Try logging in as root (or ask him to do so) and check his emails. cron usually emails root or the crontab owner if it has a problem.
|
Quote:
Quote:
|
[QUOTE=matthewg42;2980659]He sees a mail from the cron daemon. See post 20. It looks like the job is triggering, but there is an error:
You have any ideas?[/QUOTE Mathew and Chrism, In addition to the above, I've added the user to cron.allow and no users are there in cron.deny Thanks Yusuf |
Mathew and chris,
Got it.. when running the same script as root user it is executing fine and sends the mail.. whereas non root user cannot..it gives the error : /bin/sh: /home/oracrp/test/test.sh: Permission denied [oracrp@oracle test]$ ls -rlt /bin/sh lrwxrwxrwx 1 root root 4 May 24 2007 /bin/sh -> bash [oracrp@oracle test]$ ls -rlt /home/oracrp/test/test.sh -rwxr-xr-x 1 oracrp dba 47 Dec 4 15:15 /home/oracrp/test/test.sh Comments please Yusuf |
This test.sh script is the one I asked you to create right? Can you just verify what it contains?
|
All times are GMT -5. The time now is 07:37 PM. |