The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
background jobs exit status and limit the number of jobs to run GrepMe Shell Programming and Scripting 1 06-11-2007 03:56 PM
Cron Jobs lewisoco SUN Solaris 6 09-04-2005 08:14 AM
Cron Jobs dereckbc UNIX for Dummies Questions & Answers 6 01-19-2005 07:29 AM
background jobs qsi Shell Programming and Scripting 4 11-24-2004 02:45 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-27-2002
Registered User
 

Join Date: Feb 2002
Posts: 3
jobs

I am running this script below as a cron job for user root. In fact I set this job early last week and expected it to delete archive logs older than 7 days, but doesn't work - just displays the echo messages and no error. Can somebody advise me the probable causes ??

DAY_AFTER=7; export DAY_AFTER
DELETE_FROM_DIR=/u05/oracle/oradata/TOLL2/archlog; export DELETE_FROM_DIR
date
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo 'About to delete archive logs...'
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
find $DELETE_FROM_DIR -name "*.*" -mtime +$DAY_AFTER -exec rm {} \;
echo '~~~~~~~~~~~~~~~~~'
echo 'Process Complete.'
echo '~~~~~~~~~~~~~~~~~'
date
__________________
Vijay
Forum Sponsor
  #2  
Old 02-27-2002
witt
Guest
 

Posts: n/a
You can do this :

- put the absolute path of the find command : /usr/bin/find
- put the "#!/bin/sh -v" in the first line of your script to verbose a command execution.
- direct the output of your script to a file in the crontab : your_script > /tmp/script.log 2>&1


Check the result ...


Witt
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:37 AM.


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

Content Relevant URLs by vBSEO 3.2.0