![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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 |