テストデータ作成
$ rsync -ax --include "*/" --include "*.foo" --include "*.bar" --exclude "*" /src/* /test/ 2>/dev/null
コピー終了
$ cat stop.sh #!/bin/bash usedsize=`du -s /test | cut -f 1` #KB let targsize="10 * 1024 *1024" #10GB/KB if [ ${usedsize} -ge ${targsize} ];then printf "target size %'dKB\n" ${targsize} printf "used size %'dKB\n" ${usedsize} killall rsync echo rsync killed else let per="${usedsize} * 100 / ${targsize}" printf "target size %'dKB\n" ${targsize} printf "used size %'dKB %d%%\n" ${usedsize} ${per} fi $ watch bash stop.sh
めも