Export Problem in Cronjob
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Export Problem in Cronjob

  1. #1
    Join Date
    May 2001
    Location
    London
    Posts
    149
    Hi,

    I have a script which is used to take export backup of one table ,
    it is working when I execute at command prompt

    $./bkup.ksh

    but when I put in crontab, it is not running.so I am checking
    error in mail that it is not able to find exp.

    below is my shell script.

    My Backup script is bkup.ksh

    $more bkup.ksh

    #!/bin/ksh
    cd /export/home/ibbusr1
    dumpfile=rbswrd1-`date '+%d%m%Y'`.dmp
    logfile=rbswrd1-`date '+%d%m%Y'`.log
    exp ibba/password@rbswrd1 file=/export/home/ibbusr1/$dumpfile tables='credit_limit' log=/export/home/ibbusr1/$logfile


    My cronjob entry is

    $cronjob -l

    0,10,20,30,40,50 * * * * /export/home/ibbusr1/bkup.ksh

    In my mail

    $mail

    Your "cron" job on ccdev3
    /export/home/ibbusr1/bkup.ksh

    produced the following output:

    /export/home/ibbusr1/bkup.ksh[7]: exp: not found


    Thanks in advance.

    Paresh.



  2. #2
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    Hi,
    cron does not setup the environment by default.
    You have to set the PATH etc in bkup.ksh or execute the .profile file from bkup.ksh script.
    Ales
    The whole difference between a little boy and an adult man is the price of toys

  3. #3
    Join Date
    Jan 2001
    Posts
    2,828

    Talking

    Hi paresh

    In your bkup.ksh you have to specify Oracle Home ,LD_LIB path and so on.Post your bkup.sh script here .we will be able to trouble shoot it better.

    regards
    Hrishy

  4. #4
    Join Date
    May 2001
    Location
    London
    Posts
    149
    Hi,

    My backup script is below:

    #!/bin/ksh
    cd /export/home/ibbusr1
    dumpfile=rbswrd1-`date '+%d%m%Y'`.dmp
    logfile=rbswrd1-`date '+%d%m%Y'`.log
    exp ibba/password@rbswrd1 file=/export/home/ibbusr1/$dumpfile tables='credit_limit' log=/export/home/ibbusr1/$logfile



    Can u tell me , what are the things I have to add to work the script in Crontab


    Thanks

    Paresh

  5. #5
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    #!/bin/ksh

    . $HOME/.profile >/dev/null 2>&1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width