使用cpio拷贝整个目录

#!/bin/bash
#使用cpio来拷贝目录树

ARGS=2
E_BADARGS=65

if [ $#  -ne  "$ARGS" ]
then
        echo "Usage: `basename $0`  source destination"
        exit $E_BADARGS
fi

source=$1
destination=$2

find "$source" -depth | cpio -admvp  "$destination"

exit 0

你可能感兴趣的:(使用cpio拷贝整个目录)