DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Urgent help for unix ".sh not found" problem

  1. #1
    Join Date
    Feb 2001
    Posts
    14

    Question

    Hi all,
    I'm trying to get a unix backup script to work - oravis_backup.sh, but when I run it (logged in as root) it returns "oravis_backup.sh: not found". I am calling the script as follows:

    oravis_backup.sh > oravis_backup_31May01.log 2>&1 and the file itself looks like....

    # shut down all applications/listeners etc
    su oravis -c "/export/home/oravis/scripts/vis_all_stop.sh"
    #
    #tape=/dev/rmt/0n
    #
    # Rewind the tape for a complete backup
    mt -f /dev/rmt/0 rewind
    #
    # Use ufsdump for backup
    #
    /usr/sbin/ufsdump 0f /dev/rmt/0cn /dbs/oradb2/visdata
    /usr/sbin/ufsdump 0f /dev/rmt/0cn /dbs/oradb3/visdata
    /usr/sbin/ufsdump 0f /dev/rmt/0cn /dba/app/oracle/admin
    /usr/sbin/ufsdump 0f /dev/rmt/0cn /opt/appl/oracle
    /usr/sbin/ufsdump 0f /dev/rmt/0cn /export/home/oravis
    #
    #
    # Rewind the tape and put offline
    # mt -f /dev/rmt/0 rewoffl
    su oravis -c "/export/home/oravis/scripts/vis_all_start.sh"

    ...both the .sh files mentioned above exist in the same directory and I've changed the permissions using chmod to 777.

    Any clues on this one??

    Thanks,
    audere

  2. #2
    Join Date
    Mar 2000
    Location
    CA
    Posts
    317
    you need to add '/bin/sh' at the begning of the script

    Thanks
    Kishore Kumar

  3. #3
    Join Date
    Aug 2000
    Location
    Belgium
    Posts
    342
    When you log in as root, the '.' is not in you PATH. ( security )

    So you have to tell the shell where the script is.

    Try
    ./oravis_backup.sh > oravis_backup_31May01.log 2>&1

    or ( and maybe better )

    full_path/oravis_backup.sh > full_path/oravis_backup_31May01.log 2>&1

  4. #4
    Join Date
    Feb 2001
    Posts
    14
    ....thanks a lot you guys! Problem solved....

    audere

  5. #5
    Join Date
    Sep 2000
    Location
    Chennai, India
    Posts
    865
    Hi

    Can u explain the following line in u'r script?

    /usr/sbin/ufsdump 0f /dev/rmt/0cn /dbs/oradb2/visdata

    I normarlly use

    tar -cvf /dev/rmt/0 /dbs/oradb2/visdata
    tar -rvf /dev/rmt/0 /dbs/oradb3/visdata

    Thanks.

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