Veritas-bu

Re: [Veritas-bu] Restore Script.

2010-11-10 15:08:05
Subject: Re: [Veritas-bu] Restore Script.
From: Ed Wilts <ewilts AT ewilts DOT org>
To: Ulises Rodriguez <ulises.rodriguez AT wallst DOT com>
Date: Wed, 10 Nov 2010 14:08:00 -0600
Here's what we use,.  Change the SrcClient & DstClient variables and then stick in your list of files to restore. If you want to change the restore path, edit those lines or comment them out.  If you need to change the type (e.g. 13 for Windows files), change the restore command at the bottom.

#!/bin/sh

# Optional parameters: start-date end-date in mm/dd/yyyy format
# which allow restoring files backed up between dates rather than
# just the most recent copies.

# Source/destination client(s)
SrcClient=source.domain.com
DstClient=destination.domain.com

AltPath=/var/tmp/restore-$$-alt-path
Files=/var/tmp/restore-$$-files
Log=/var/tmp/restore-$$-log
id=`/usr/xpg4/bin/id -u`
if [ "$id" -eq 0 ]
then
   Restore=/usr/openv/netbackup/bin/bprestore
else
   Restore='sudo /usr/openv/netbackup/bin/bprestore'
fi

[ -n "$1" ] && start="-s $1"
[ -n "$2" ] && end="-e $2"
[ -f $Log ] && rm -f $Log

# List of files to be restored
cat > $Files <<EOF
/tracker.tar
EOF

# Restore to an alternate path
# format is "change old-path to new-path"
cat > $AltPath <<EOF
change /tracker.tar to /restore/tracker.tar
EOF

[ -f $AltPath ] && altp="-R $AltPath"
cmd="$Restore -K -C $SrcClient -D $DstClient -f $Files -L $Log $start $end $altp"

date > $Log
echo "$cmd" >> $Log
$cmd

echo Progress log is in $Log
echo "When finished, please delete /var/tmp/restore-$$-*"




On Wed, Nov 10, 2010 at 1:54 PM, Ulises Rodriguez <ulises.rodriguez AT wallst DOT com> wrote:
> All,
>
>  
>
> I have a huge restore to do, I was wondering if any of you have a script
> that I can feed a XLS,TXT, CSV file with the files I need to restore. The
> file contains the server name, path and file name.
>
>  
>
> Please let me know if this is even possible.
>
>  
>
> Thank you,
>
> Ulises Rodriguez
> Operations Support
>

_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
<Prev in Thread] Current Thread [Next in Thread>