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 Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 07:56 PM
Cron Jobs lewisoco SUN Solaris 6 09-04-2005 12:14 PM
Cron Jobs dereckbc UNIX for Dummies Questions & Answers 6 01-19-2005 10:29 AM
background jobs qsi Shell Programming and Scripting 4 11-24-2004 05:45 AM

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 02-28-2002
vbaskar vbaskar is offline
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
  #2 (permalink)  
Old 02-28-2002
witt
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
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
Closed Thread

Bookmarks

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 06:12 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