#!/bin/sh # # This little script will tar up the repository from the # directory defined by the first argument and copy it to the # userid@node defined by the second and third arguments using # rcp. The optional fourth argument defines the temporary # area to contain the local copy of the tar ball. # # The xtra_tar variable is available to add those other files # and directories which exist and are deemed useful. (See section # of the script) # cd xtra_tar='' repository=${1} new_user=${2} new_home=${3} tmp_disk=/${4} [ -z ${new_home} ] && exit 2 [ "${tmp_disk}" = "/" ] && tmp_disk=/data92/software/cdfcvs [ -d ${tmp_disk}/${repository}_work ] && rm -r ${tmp_disk}/${repository}_work # # Define the other files and directories to be added to the tar file # [ -f .k5login ] && xtra_tar="${xtra_tar} .k5login" # [ -d bin ] && xtra_tar="${xtra_tar} bin" # [ -d cvs ] && xtra_tar="${xtra_tar} cvs" # [ -f .rhosts ] && xtra_tar="${xtra_tar} .rhosts" # [ -f .shosts ] && xtra_tar="${xtra_tar} .shosts" [ -f .history ] && xtra_tar="${xtra_tar} .history" [ -f .cvspass ] && xtra_tar="${xtra_tar} .cvspass" #[ -f .cvshrc ] && xtra_tar="${xtra_tar} .cvshrc" [ -f .admin ] && xtra_tar="${xtra_tar} .admin" [ -f .forward ] && xtra_tar="${xtra_tar} .forward" [ -f .cvsignore ] && xtra_tar="${xtra_tar} .cvsignore" [ -d .ssh ] && xtra_tar="${xtra_tar} .ssh" owd=`pwd` cd ${tmp_disk} # in case its automounted mkdir ${tmp_disk}/${repository}_work cd ${owd} echo 'Okay, Rolling tar ball.' time tar -cf ${tmp_disk}/${repository}_work/${repository}.tar \ ${repository} ${xtra_tar} echo 'Okay, Copying tar ball to' ${new_user}@${new_home} time /usr/krb5/bin/rcp -r ${tmp_disk}/${repository}_work \ ${new_user}@${new_home}: echo 'Okay, Cleaning up.' cd rm -r ${tmp_disk}/${repository}_work