The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Cron issue kingdbag SUN Solaris 5 07-10-2008 08:14 AM
FTP Cron Issue edua Shell Programming and Scripting 7 11-26-2007 11:30 PM
Issue with cron job -Please help bsandeep_80 Shell Programming and Scripting 6 07-27-2007 11:20 AM
Issue with cron job nattynatty Shell Programming and Scripting 1 11-21-2005 03:37 PM
cron issue Optimus_P UNIX for Advanced & Expert Users 5 08-26-2002 10:30 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-13-2008
Registered User
 

Join Date: Oct 2007
Posts: 1
Stumble this Post!
Another Cron issue.

Hey guys,

I have a script called my_test:
Code:
# !/usr/bin/sh
`touch /usr/test/me`
The script has been saved in /usr/test/my_test
I have executed chmod 755 /usr/test/my_test
Then I have entered it into the cron file using crontab -e
Code:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/test/my_test > /usr/test/mytestlog
I was hoping that the script would be executed every 5 minutes, the file /usr/test/me would be timestamped with the last touch and the last touch would be logged in /usr/test/mytestlog.

What I am finding, every 5 minutes the mytestlog has been created, (timestamped when the cron last fired.) but the /usr/test/me file hasn't been timestamped and the log file is empty.

To me, it looks like the cron is firing, but the script hasn't executed. It executes manually but not from the cron. The script was created by root, the cron was created by root, its displayed in the cron when I type
Code:
crontab -l
and it looks like it has fired without error in the /var/cron/log file.

Can anyone shed any light on how I can track down this problem.

Thanks in advance.

Added: Its on a sun box.

Last edited by Beefy; 03-13-2008 at 07:58 AM. Reason: More information
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-13-2008
vbe vbe is offline
Moderator
 

Join Date: Sep 2005
Location: Switzerland
Posts: 543
Stumble this Post!
Just tested since I couldnt see what was wrong...
I created a /sm/test dir...(chmod 777...)
And well in my context it works...
ant:/sm/test $ date
Thu Mar 13 18:20:33 MET 2008
ant:/sm/test $ ll
total 2
-rw-rw-rw- 1 vbe bin 0 Mar 13 18:20 me
-rwxrwxr-x 1 vbe bin 35 Mar 13 18:14 my_test
-rw-r--r-- 1 root sys 0 Mar 13 18:20 mytest.log
ant:/sm/test $ date
Thu Mar 13 18:21:32 MET 2008
ant:/sm/test $ ll
total 2
-rw-rw-rw- 1 vbe bin 0 Mar 13 18:22 me
-rwxrwxr-x 1 vbe bin 35 Mar 13 18:14 my_test
-rw-r--r-- 1 root sys 0 Mar 13 18:22 mytest.log
ant:/sm/test $ ll
total 2
-rw-rw-rw- 1 vbe bin 0 Mar 13 18:22 me
-rwxrwxr-x 1 vbe bin 35 Mar 13 18:14 my_test
-rw-r--r-- 1 root sys 0 Mar 13 18:22 mytest.log
ant:/sm/test $
So you may have to say a bit more...
(Here this is an HP9000/rp5450 box running hpux11.11)
Reply With Quote
  #3 (permalink)  
Old 03-13-2008
vbe vbe is offline
Moderator
 

Join Date: Sep 2005
Location: Switzerland
Posts: 543
Stumble this Post!
forgot to add:
/usr/test/my_test > /usr/test/mytestlog 2>&1 # I would add if you suspect some error and want to see...
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0