#!/usr/bin/ksh
cmd=$0
old=$1
new=$2
if [ $# != 2 ]
then
echo Syntax: ${cmd} "<src_directory>" "<new_directory>"
exit 1
fi
# since the directory names might be entered as relative to current directory
# change to each of the directories and set a full path name for each
#verify source directory exists
cd $old
if [ $? != 0 ]
then
echo ${cmd}: cannot change directory to ${old}
exit 1
fi
src=`pwd`
cd -
#verify target/destination directory exists
cd $new
if [ $? != 0 ]
then
echo ${cmd}: cannot change directory to ${new}
exit 1
fi
target=`pwd`
cd -
# perform copy
cd ${src}
find . | backup -if - | (cd ${target}; restore -xqf -)
# return the exit value of the command above
exit $?
Article Number: 82
Posted: Mon, May 28, 2018 11:14 AM
Last Updated: Mon, May 28, 2018 11:14 AM
Online URL: http://kb.ictbanking.net/article.php?id=82