| |
---|
| | |
---|
| | # Symlinks require special care |
---|
| | if [ -L $arg ] |
---|
| | then |
---|
| | REALPATH=$(readlink -f $(dirname $arg))/$arg |
---|
| | |
---|
| | # Bare symlink itelf |
---|
| | REALPATH=$(readlink -f $(dirname $arg)) |
---|
| | if [ ${REALPATH} = '/' ] |
---|
| | then |
---|
| | REALPATH="" |
---|
| | fi |
---|
| | |
---|
| | REALPATH=${REALPATH}/$(basename $arg) |
---|
| | |
---|
| | # Process normal files and directories |
---|
| | else |
---|
| | REALPATH=$(readlink -f $arg) |
---|
| |
---|
| | SERIAL=".$(date +%Y%m%d%H%M%S)" |
---|
| | fi |
---|
| | |
---|
| | SRCDIR=$(dirname $REALPATH) |
---|
| | if [ ${SRCDIR} = '/' ] |
---|
| | then |
---|
| | SRCDIR="" |
---|
| | fi |
---|
| | SRCFIL=$(basename $REALPATH) |
---|
| | DESDIR=${GRAVEYARD}${SRCDIR} |
---|
| | DESFIL="${SRCFIL}${SERIAL}" |
---|
| | |
---|
| | CMD="${OPERATOR} $VERBOSE '${REALPATH}' '${DESDIR}/${DESFIL}'" |
---|
| | |
---|
| | if [ -n "${TESTMODE}" ] |
---|
| | then |
---|
| | echo ${TESTMODE} |
---|
| | echo ${CMD} |
---|
| |
---|
| | |