bLu*_*dDy 10 linux bash rsync xargs
我做了一个启动并行rsync进程的脚本:
#! /bin/bash
LIST=$1
DEST_DIR=$2
RSYNC_OPTS=$3
#echo "rsyncing From=$SRC_DIR To=$DEST_DIR RSYNC_OPTS=$RSYNC_OPTS"
echo $LIST|xargs -n1 -d, echo|xargs -n1 -P 0 -I% rsync --rsync-path='sudo rsync' ${RSYNC_OPTS} % ${DEST_DIR}
Run Code Online (Sandbox Code Playgroud)
然后,我有问题获得rsync进程的退出状态.我知道有可能获得一个pipestatus数组,但我需要捕获退出代码以了解rsync是否成功.
有谁知道?