Commit 7090569 1 parent b1d40bc commit 7090569 Copy full SHA for 7090569
File tree 4 files changed +37
-2
lines changed
4 files changed +37
-2
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/expect -f
2
+ set ip [lindex $argv 0]
3
+ set timeout 1200
4
+ spawn /usr/bin/scp -r 192.168.10.10:/data/www/ /data/
5
+ expect {
6
+ " (yes/no)?" {send " yes\r" }
7
+ " *password:" {send " www.aqzt.com\r" }
8
+ }
9
+ expect " password:"
10
+ send " 123456\r"
Original file line number Diff line number Diff line change @@ -21,6 +21,15 @@ find /data/nginx/log/ -ctime +5 -exec rm -f {} \;
21
21
find /data/logs -ctime +5 -exec rm -f {} \;
22
22
find /data/logs -name " localhost_access_log*.txt" -type f -mtime +5 -print -exec rm -f {} \;
23
23
24
+
25
+ # #删除目录下所有的 .svn 隐藏子目录
26
+ find . -name .svn -print0 | xargs -0 rm -r -f
27
+ find /data/file1 -name .svn -print0 | xargs -0 rm -r -f
28
+ find /data/file1 -name .git -print0 | xargs -0 rm -r -f
29
+ find . -name .svn -print0 | xargs -0 rm -r -f
30
+ find . -name .git -print0 | xargs -0 rm -r -f
31
+
32
+
24
33
# #找出 n 天前的文件
25
34
find /temp/ -type f -mtime +n -print
26
35
Original file line number Diff line number Diff line change @@ -24,4 +24,19 @@ sed -i "s/text_to_replace/replacement/g" `find . -type f -name <filename>`
24
24
sed -i " s/10.0.0.75/10.0.0.76/g" ` find . -type f -name " *.properties" `
25
25
sed -i " s/10.0.0.18/10.0.0.17/g" ` find . -type f -name " *.properties" `
26
26
sed -i " s/10.0.0.16/10.0.0.17/g" ` find . -type f -name " *.php" `
27
- sed -i " s/d12/111222/g" ` find . -type f -name " *.properties" `
27
+ sed -i " s/d12/111222/g" ` find . -type f -name " *.properties" `
28
+
29
+
30
+ # sed删除文件倒数10行
31
+ # 把文件倒序
32
+ sed -i ' 1!G;$!h;$!d' filename
33
+ # 删除10行
34
+ sed -i ' 1,10d' filename
35
+ # 把文件倒序回来
36
+ sed -i ' 1!G;$!h;$!d' filename
37
+
38
+ nl file | tail -n 10 | awk ' NR == 1 ' {print $1 }'
39
+
40
+ awk ' BEGIN{CMD=" wc -l file" ; CMD| getline i}NR< =(i-10)' file
41
+ sed -n ' :a; 1,10! {P; N; D; }; N; ba' file
42
+
Original file line number Diff line number Diff line change 5
5
# #robert yu
6
6
# #centos 6
7
7
8
-
8
+ yum install -y gcc net-snmp
9
9
10
10
cat > /etc/snmp/snmpd.conf<< EOF
11
11
com2sec notConfigUser 127.0.0.1 public
@@ -20,4 +20,5 @@ access notConfigGroup "" any noauth exact all none none
20
20
dontLogTCPWrappersConnects yes
21
21
EOF
22
22
23
+ /sbin/chkconfig snmpd on
23
24
/sbin/service snmpd restart
You can’t perform that action at this time.
0 commit comments