Forum Discussion

7 Replies

  • You could write a shell script (if customers system is UNIX based) and that may work.

    Otherwise you could give your user/s access to the Backup, Archive and Restore GUI, but this gives them access to restore from all systems.

     

    Normally you would restrict restores only to administrators.

  • I cannot see this being automated unless you are a very accomplished script writer.

    Get your users to start using bprestore command.

    Using bprestore from cmd (or script) to alternate folder requires setup of <RenameFile>. If more than one folder needs to be restored, <RestoreFileList> text file will also be needed. See http://www.symantec.com/docs/TECH21196

    Another thought:

    Why not just teach them to use the GUI? Client-side GUI will be easiest.
    See NBU Backup, Archive, and Restore Getting Started Guide  http://www.symantec.com/docs/DOC3642

     

     

  • Interactive scripts for users? That would be an intensive task to do from my opinion, not to mention keeping track of the request logs.

    My suggestion: you can setup security for your Netbackup environment, either by NBAC or Java console auth.conf. This would allow you to create a "shared" user (or even more users) who can only access the GUI to perform restore-only task.

  • Netbackupfan,

     

    You need to ask yourself the question. Do you want users to be able to restore from any client backup to any system? This poses possible security conflicts.

  • Here is a basic interactive restore script as requested.

    At the moment, this does NOT cope with alternate location restores - I'll add this when I get time.

    It does not really do any checking - for example, is the master server name entered valid etc ...  This is not really essential for basic functionality, I might add this in if I get time.

    Run it like this ..  /tmp/filelist contains the list of files to restore in format :

    /path/to/file1

    /path/to/file2

     

    Run it like this ...

     ./restore2.sh 04/16/2012

     

    Tmp restore directory /tmp/sym/restore already exists
    Please enter value for MASTER
    womble
    Please enter value for SOURCE
    womble
    Please enter value for DESTINATION
    womble
    Please enter value for FILELIST
    /tmp/filelist
     
     
    Here is the script ...

     

    #!/usr/bin/ksh
     
    #Define a few variables ...
     
    DIR=/tmp/sym/restore   #DIR used for 'tmp' files
    LOG=$DIR/restore_log.txt
    FILELIST=$DIR/FILELIST
    MASTER=$DIR/MASTER
    SOURCE=$DIR/SOURCE
    DESTINATION=$DIR/DESTINATION
    STARTDATE=$1
     
    #Create directory
     
    create_dir () {
            if [[ -d $DIR ]]
                    then
                    echo "Tmp restore directory $DIR already exists"
            else
                    mkdir $DIR
                    echo "Created directory $DIR"
            fi
    }
     
    collect_values () {
     
    for i in MASTER SOURCE DESTINATION FILELIST
     do
      echo "Please enter value for $i"
      read VALUE
      echo $VALUE >$DIR/$i
     done
    }
     
    run_restore () {
     
    bprestore -s $STARTDATE -S $(cat $MASTER) -C $(cat $SOURCE) -D $(cat $DESTINATION) -L $LOG  -f $(cat $FILELIST)
    }
     
    #Main script
     
    create_dir
    collect_values
    run_restore