LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Specific Crontab Job is not executed . (https://www.linuxquestions.org/questions/linux-server-73/specific-crontab-job-is-not-executed-536595/)

Itsik Harel 03-11-2007 01:56 PM

Specific Crontab Job is not executed .
 
Hello

A specific Cron job is not executed (The bold one), i checked the /var/log/cron log file and i see an entry for this job at exactly 23:00 ... but i dont see the expected output produced as if this script was not executed ...
needless to say that all the other cron jobs run perfectly
also the script it self works 100% just not via cron .


My Cron :
######################################
# Node2 / Rac2 Cron list #############
######################################
## Remove old archives 4 days old ####
00 06 * * * /ora_data/Scripts/rm_arc/rm_arc.sh 1> /ora_data/Scripts/rm_arc/rm_arc.log
######################################
## Rename Alert\Listener log file ####
00 20 * * 0,4 /ora_data/Scripts/alert_log/rename_alert.sh
00 21 * * 0,4 /ora_data/Scripts/alert_log/rename_listener.sh
######################################
## Export Full DB/Remove older files #
00 23 * * 1,3,5 /ora_data/Scripts/exp/expdp_rac2.sh
######################################
## Backup the Voting and Ocr files ###
01 19 * * * /ora_data/Scripts/crs/crs.sh


vi /ora_data/Scripts/exp/expdp_rac2.sh:

#!/bin/bash

# This Script use data pump export to export the entire rac db.

# ENV
DATE=`date +%F`

# Remove export files older then 7 days.
find /app/exp_dir_rac1/ -ctime +7 -exec rm -f {} \;

# Full Export of The Rac .
/app/oracle/bin/expdp system/oracle@rac1 full=y dumpfile=full.dmp.$DATE logfile=full.log.$DATE PARALLEL=2 directory=EXP_DIR_RAC1


Many Thanks
Itsik

wjevans_7d1@yahoo.co 03-11-2007 09:11 PM

The only two things I can think of are these:
  1. I don't think there are any environment variables available to you for execution of a cron job. To see whether this is your problem, empty out all your variables at the command line (so there are no environment variables any more, none at all) and run the script to see what happens.
  2. One of those environment variables which is probably not available is PATH. This means that you need to expand the date and find commands to their full pathnames.

Hope this helps.


All times are GMT -5. The time now is 04:02 PM.