summaryrefslogtreecommitdiff
path: root/bin/dd_r3
diff options
context:
space:
mode:
authorlishu <[email protected]>2018-11-28 21:45:37 +0800
committerlishu <[email protected]>2018-11-28 21:45:37 +0800
commitcf2684a100afcfa3076d6afe7235c62394ff77eb (patch)
treefa73ad467894bd435c3538cd97590f136707c844 /bin/dd_r3
parent00ab3d6d0a00d310e0964f9d2237c6a2d68b825e (diff)
增加安装使用手册
Diffstat (limited to 'bin/dd_r3')
-rw-r--r--bin/dd_r321
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/dd_r3 b/bin/dd_r3
new file mode 100644
index 0000000..389d6e3
--- /dev/null
+++ b/bin/dd_r3
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+while [ 1 ]; do
+ count=`ls -l core.* |wc -l`
+ echo $count
+ if [ $count -lt 5 ]
+ then
+ echo "set unlimited"
+ ulimit -c unlimited
+ else
+ ulimit -c 0
+ fi
+
+ dd_num=`ps -ef|grep dd$|wc -l`
+ if [ $dd_num -lt 1 ]
+ then
+ ./dd &>/dev/null &
+ echo program crashed, restart at `date +"%w %Y/%m/%d, %H:%M:%S"` >> RESTART.log
+ fi
+ sleep 10
+done