Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Ray.Bellis@psy.ox.ac.uk (Ray Bellis)
Subject: Re: [Q-HELP] How remote "vdump" on DEC UNIX3.2c
Date: 1996/01/26	[thread overview]
Message-ID: <wwvohrrqpp9.fsf@axp01.mrc-bbc.ox.ac.uk> (raw)
In-Reply-To: DLLtLw.7Jz@plato.ds.boeing.com

In article <DLLtLw.7Jz@plato.ds.boeing.com> haro@fclzoo.itdl.ds.boeing.com (John S. Haro) writes:

> [Q1] Anyone have any info on remote "vdump" and "vrestore" for Digital 
> UNIX 3.2c ADVFS (Advanced File System) structure?
> 
> DEC says there is no remote commands for these backup utils, like rdump 
> and rrestore.
> 
> The only suggestion from DEC is to do via dd, eg:
> 
>    vdump -0uf /usr | rsh (tapehost) dd bs=60k of=/dev/rmt0h
> 
> and 
> 
>    rsh (tapehost) "dd if=/dev/rmt0h bs=60k" | vrestore -xvf -

I announced this about six months ago on the alpha-osf-managers e-mail
list but I've only ever sent it out on request to individuals.  I
guess this has been around long enough that people would have told me
if there were any problems.  I haven't written an `rvrestore' yet.

--8<--8<-- cut here --8<--8<--
#!/bin/ksh
#
#  rvdump
#
#  vdump script which accepts `-f [[user@]host:]device' for dumping
#  to a remote device
#
#  (C) R.P.Bellis 1995, Redistribute Freely
#

# set location of programs used
dd=/bin/dd
getopt=/bin/getopt
rsh=/bin/rsh
tr=/bin/tr
vdump=/sbin/vdump

# parse command line arguments
set -- `$getopt 0123456789CDNVhquvwF:T:b:f:x: $*`
if [ $? != 0 ]
then
	exec $vdump
fi

# set initial variables
level=""
file=""
args=""
bs="60"

# scan argument list
while [ $1 != -- ]
do
	case $1 in
		-[0-9])
			if [ "$level" = "" ]; then
			  level=$1
			else
			  exec $vdump
			fi
			;;
		-F|-T|-x)
			args="$args $1 $2"
			shift
			;;
		-b)
			bs="$2"
			shift
			;;
		-f)
			file="$2"
			shift
			;;
		*)
			args="$args $1"
			;;
	esac
	shift
done

# remove -- from arg list
shift

# check for single final parameter
if [ $# -ne 1 ]; then
  exec $vdump
fi

# check for host:device dump file
echo $file | $tr ':' ' ' | read host device

if [ "$device" = "" ]; then	# do local device backup

  # run the dump command
  $vdump $level $args -b $bs -f $file $1

else				# do remote device backup

  # check for user@host
  echo $host | $tr '@' ' ' | read user host
  if [ "$host" = "" ]; then
    host=$user
    user=""
  fi

  # add -l flag for `rsh' if a username was specified
  if [ "$user" != "" ]; then
    user="-l $user"
  fi

  # run the dump command
  $vdump $level $args -b $bs -f - $1 | $rsh $host $user $dd of=$device bs=${bs}k

fi
--8<--8<-- cut here --8<--8<--
-- 
  Computing Officer, MRC Research Centre in Brain and Behaviour,
     Department of Experimental Psychology, Oxford University
  <http://www.mrc-bbc.ox.ac.uk/~rpb>  <mailto:Ray.Bellis@psy.ox.ac.uk>



  reply	other threads:[~1996-01-26  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-01-22  5:00 [Q-HELP] How remote "vdump" on DEC UNIX3.2c John S. Haro
1996-01-26  5:00 ` Ray Bellis [this message]
1996-01-29  5:00   ` rmj
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox