The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 not working manna UNIX for Dummies Questions & Answers 1 01-10-2008 02:04 PM
Cron not working? christo16 UNIX for Dummies Questions & Answers 5 03-09-2007 02:55 AM
cron not working DaleCabell UNIX for Dummies Questions & Answers 1 07-28-2006 07:16 PM
Cron job not working janavenki Shell Programming and Scripting 7 03-10-2004 12:36 PM
CRON - How to tell it's working? jaffy1229 UNIX for Dummies Questions & Answers 7 04-15-2002 12:09 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-25-2007
dkranes dkranes is offline
Registered User
  
 

Join Date: Apr 2007
Location: Hudson Valley Region in New York
Posts: 43
Cron job not working

Hello, I have the following crontab entry that does not seem to be running. When I check /var/cron/log, it is not there. Here is my os info:

SunOS birch 5.9 Generic_118558-09 sun4u sparc SUNW,Sun-Fire-V240

Here is the crontab entry:
01 21 * * * find /export/app/datafeed/flus/archive -mtime +5 -exec rm -r {} \;
Any suggestions as to why it is not executing?

Thank you.

David
  #2 (permalink)  
Old 10-25-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,952
Few questions to check:

Were there files with specified condition to be deleted ?
Are there necessary permissions to delete the selected files ?
  #3 (permalink)  
Old 10-25-2007
dkranes dkranes is offline
Registered User
  
 

Join Date: Apr 2007
Location: Hudson Valley Region in New York
Posts: 43
The files are owned by the same user in which the crontab entry is located. Shouldn't there be logging on /var/cron/log if it attempted to run? There may not have been files old enough to be deleted at the time it was run last.


David
  #4 (permalink)  
Old 10-25-2007
udaykishore udaykishore is offline
Registered User
  
 

Join Date: May 2006
Location: London
Posts: 19
test it by printing

For testing , U make one more entry in crontab to list those filenames which are modified morethan 5 days like this.

01 21 * * * find /export/app/datafeed/flus/archive -mtime +5 -print >$HOME/test.log

U check whether test.log is created or not.if it is created means cron is working, otherwise not.
  #5 (permalink)  
Old 10-25-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
On just a point of style and manageability, I make my crontab entries call a single script, then have the script do all the fancy foot work.

1. it means I can simply add any tracing I need

2. it means I can test exactly the same thing outside of crontab

3. my crontab contains the minimum, eg when and what command
  #6 (permalink)  
Old 10-26-2007
dkranes dkranes is offline
Registered User
  
 

Join Date: Apr 2007
Location: Hudson Valley Region in New York
Posts: 43
Yes, I have now done just this. I created a single script to do the work. Thank you.

David
Closed Thread

Bookmarks

Tags
mtime

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0