間違いだらけの備忘録

このページの内容は無保証でありこのページの内容によって直接、または間接に損害を受けられたとしても私は責任を取りません。

テストデータコピー

テストデータ作成

$ 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

めも

このページにはhatena以外のサービスからのコンテンツが埋め込まれています。 hatenaによりGoogle AdSense 広告が埋め込まれています。