-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinux.txt
478 lines (356 loc) · 18.4 KB
/
linux.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
du -h --max-depth=1 /
lsof | grep delete
ps -ef | grep php
kill -9 xxxx
whereis httpd
date
cat /dev/null > /var/log/error_log.log
du -sh /* 2>/dev/null | sort -hr | head -3
yum -y install epel-release
yum clean
yum clean headers
yum clean packages
yum clean oldheaders
ÍøÂç
mtr vpngate.net
¶Ë¿Ú¼ì²â
netstat -a | egrep 'Proto|LISTEN'
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
cat /proc/cpuinfo | grep physical | uniq -c
cat /proc/meminfo
cat /proc/version
uname -a
ÈÕÖ¾Çиî
usr/local/tomcat/apache-tomcat-7.0.54/logs/catalina.out {
rotate 31
daily
copytruncate
compress
notifempty
missingok
dateext
}
rotate 31 ±íʾ±£Áô31ÌìµÄ±¸·ÝÎļþ
daily ±íʾÿÌìÕûÀíÒ»´Î
copytruncate ±íʾÏȸ´ÖÆlogÎļþµÄÄÚÈÝ£¬È»ºóÔÙÇå¿Õ
compress ±íʾѹËõ±¸·ÖÎļþ
missingok ±íʾÈç¹ûÕÒ²»µ½logÎļþҲûOK
notifempty ±íʾÈç¹ûlogÎļþÊǿյģ¬¾Í²»½øÐÐrotate
dateext ±íʾ±¸·ÝµÄÈÕÖ¾Îļþºó׺¸ñʽΪYYYYMMDD
¿ÉÒÔͨ¹ý/usr/sbin/logrotate -f /etc/logrotate.confÀ´Ö´ÐÐ
## ºǫ́ÔËÐÐÃüÁî
nohup command {option} > myout.file 2>&1 &?
## ¿ª·Å¶Ë¿Ú
netstat -tunlp
#!/bin/ksh
#crontab -e
#0,5,10,15,20,25,30,40,45,50,55 * * * * /usr/bin/autokill.sh & #ÉèÖÃΪÿ5·ÖÖÓ¼ì²éÒ»´Î³¬Ê±½ø³Ì
#ΪÁË°²È«±£ÏÕÆð¼û,´Ë°æ½Å±¾µÄÇå³ý·¶Î§Îª:ÓÉÖÕ¶ËÆô¶¯µÄ,Õ¼ÓÃCUPʱ¼ä³¬¹ýÖ¸¶¨Ê±¼ä³¤¶ÈµÄ,·ÇrootÓû§µÄ½ø³Ì»ò½©Ê¬½ø³Ì ^_^
#¼ì²â²ÎÊý
killlog="/tmp/kill.log" #ĬÈÏ×Ô¶¯Çå³ý³¬Ê±½ø³Ì»ò½©ËÀ½ø³ÌµÄÈÕÖ¾
out=60 # ĬÈϵij¬Ê±Ê±¼ä£¬ÒÔÃëΪµ¥Î»£¬Ä¬ÈÏΪ60Ã룬·¶Î§Îª10Ãë--36000Ãë
trap 'rm /tmp/kill.tmp 2>/dev/null' 0 1 2 3 9 15
test $LOGNAME != root && { echo "Sorry ! ±¾ ½Å ±¾ Ö» ÄÜ ÓÉ root ²Ù ×÷ !
" ; exit 1 ; }
test "$out" || { echo "
³¬Ê±Ê±ÏÞ²»ÄÜΪ¿Õ
" ; exit 1 ; }
test "$(echo $out | sed -n '/^[0-9][0-9]*$/p')" || { echo "
³¬Ê±Ê±ÏÞÖ»ÄÜΪÕûÊýÖµ
" ; exit 1 ; }
test $out -ge 10 -a $out -le 36000 || { echo "
³¬Ê±Ê±ÏÞ·¶Î§Îª10Ãë--36000Ãë
" ; exit 1 ; }
#²éÕÒ³¬Ê±»ò½©Ê¬½ø³Ì
ps -efl |awk -v outtest=$out '{ outtime=timetest($14) }
$2~/Z/ || ( $3!~/root/ && $13!~/?/ && outtime=="outtime" )
{print $3,$4,$13,$2,$14,$15 }
function timetest(ot)
{
hour=substr(ot,1,2)
min=substr(ot,4,2)
sec=substr(ot,7,8)
if ( hour*3600+min*60+sec > outtest)
return "outtime"
else
return "good"
} ' >/tmp/kill.tmp 2>/dev/null
#±£´æÇå³ýÁбí
if [ -s /tmp/kill.tmp ]
then
pass=0
error=0
echo "
Çå ³ý ʱ ¼ä: "$(date +%y/%m/%d-%H:%M:%S)"
" >> $killlog
awk 'BEGIN{printf("%-8s%-8s%-8s%-7s%-10s%-30s
"),"Óû§Ãû","½ø³ÌºÅ","Öն˺Å","״̬","Õ¼ÓÃʱ¼ä","ÈÎÎñÃû"}
{ state=statetest($4) ; printf("%-8s%-8s%-8s%-7s%-10s%-30s
"),$1,$2,$3,state,$5,$6} END{print "
"}
function statetest(test)
{
if (test=="S") return "˯Ãß"
if (test=="R") return "ÔËÐÐ"
if (test=="Z") return "½©Ê¬"
if (test=="O") return "²»´æÔÚ"
if (test=="B") return "µÈ´ý"
if (test=="T") return "Í£Ö¹"
if (test=="I") return "Öмä"
}' /tmp/kill.tmp >> $killlog 2>/dev/null
#Çå³ý½ø³Ì
for pid in $(awk '{print $2}' /tmp/kill.tmp |sort -rn)
do
kill -9 $pid
test $? -eq 0 &&
{ echo "×Ô¶¯Çå³ý½ø³Ì $pid ³É¹¦" | awk '{printf("
%-14s%-10s%-4s"),$1,$2,$3}' ;
echo "×Ô¶¯Çå³ý½ø³Ì $pid ³É¹¦" | awk '{printf("%-14s%-10s%-4s
"),$1,$2,$3}'
>> $killlog 2>/dev/null ; pass=$((pass+1)) ; } ||
{ echo "×Ô¶¯Çå³ý½ø³Ì $pid ʧ°Ü" | awk '{printf("
%-14s%-10s%-4s"),$1,$2,$3}' ;
echo "×Ô¶¯Çå³ý½ø³Ì $pid ʧ°Ü" | awk '{printf("%-14s%-10s%-4s
"),$1,$2,$3}'
>> $killlog 2>/dev/null ; error=$((error+1)) ; }
done
#±£´æ×îÖÕͳ¼Æ½á¹û
test $error -eq 0 &&
{ echo "´Ë´Î¹²Çå³ý ${pass} ¸ö½ø³Ì³É¹¦" | awk '{printf("
%-14s%-4s%-10s
"),$1,$2,$3}'
echo "´Ë´Î¹²Çå³ý ${pass} ¸ö½ø³Ì³É¹¦" | awk '{printf("
%-14s%-4s%-10s
"),$1,$2,$3}'
>> $killlog 2>/dev/null ; } ||
{ echo "´Ë´Î¹²Çå³ý ${pass} ¸ö½ø³Ì³É¹¦ ${error} ¸ö½ø³Ìʧ°Ü" |
awk '{printf("
%-14s%-4s%-16s%-10s%-10s
"),$1,$2,$3,$4,$5}' ;
echo "´Ë´Î¹²Çå³ý ${pass} ¸ö½ø³Ì³É¹¦ ${error} ¸ö½ø³Ìʧ°Ü" |
awk '{printf("
%-14s%-4s%-16s%-10s%-10s
"),$1,$2,$3,$4,$5}' >> $killlog 2>/dev/null ; }
fi
iptables -L
iptables -I INPUT -s 183.160.107.239 -p tcp --dport 3306 -j ACCEPT
iptables -I INPUT -s 180.162.0.0/16 -p tcp --dport 3306 -j ACCEPT
iptables -I INPUT -s 36.7.0.0/16 -p tcp --dport 3306 -j ACCEPT
iptables-save
iptables-restore
//####±¸·Ýͬ²½
yum install xtrabackup
innobackupex --user=root --password=MJsujrctG6pU0OUG --defaults-file=/etc/my.cnf /transimg/back --include=wushi --no-timestamp
--include=navy
--databases=navy
######script.sh
#!/bin/sh
MYSQL="mysql -h123.57.133.51 -uley -pzq1988 --default-character-set=utf8 -A -N"
stime=`date -d "20 day ago" +%s`
sql="SELECT COUNT(*) AS c FROM mycrm.xy_account WHERE style=0 AND ((block=0) or (block=1 and blocktime>$stime and blocktime is not null))"
# echo $sql
result="$($MYSQL -e "$sql")"
# result=726
pagesize=30
page=$(($result/$pagesize+1))
# echo $page
for((k=1;k<=$page;k++))
do
MM=`ps -aux |grep "php /data/cron/script2.php $k $pagesize"$ |grep -v "grep" |wc -l`
if [ "$MM" == "0" ]; then
echo "$k restart"
nohup php /data/cron/script2.php $k $pagesize >> /data/cron/script2.log 2>&1 &
fi
done
MM=`ps -aux |grep "php /data/cron/createsendorder.php" |grep -v "grep" |wc -l`
if [ "$MM" == "0" ]; then
nohup php /data/cron/createsendorder.php >> /data/cron/createsendorder.log 2>&1 &
fi
###### Çå³ý½ø³Ì clear kill
#!/bin/sh
if [ $# -lt 1 ]
then
echo "ȱÉÙ²ÎÊý"
exit 1
fi
ps -ef|grep $1|grep -v grep|awk '{print $2}'|xargs kill -9
chattr +i /ÍøվĿ¼/.user.ini
//×ÖÌå
centos
yum install bitmap-fonts bitmap-fonts-cjk
ubuntn
sudo apt-get install xfonts-wqy
//nodejs
yum install epel-release
// ssl Ö¤Êé
// Éú³É·þÎñÆ÷¶Ë˽Կ
ÃüÁopenssl genrsa -out api.transportjp.com.server.key 1024
// Éú³É·þÎñÆ÷¶Ë¹«Ô¿
ÃüÁopenssl rsa -in api.transportjp.com.server.key -pubout -out api.transportjp.com.server.pem
// Éú³É CA ˽Կ
ÃüÁopenssl genrsa -out api.transportjp.com.ca.key 1024
ÃüÁopenssl req -new -key api.transportjp.com.ca.key -out api.transportjp.com.ca.csr
ÃüÁopenssl x509 -req -in api.transportjp.com.ca.csr -signkey api.transportjp.com.ca.key -out api.transportjp.com.ca.crt
// ·þÎñÆ÷¶ËÐèÒªÏò CA »ú¹¹ÉêÇëÇ©ÃûÖ¤Ê飬ÔÚÉêÇëÇ©ÃûÖ¤Êé֮ǰÒÀÈ»ÊÇ´´½¨×Ô¼ºµÄ CSR Îļþ
ÃüÁopenssl req -new -key api.transportjp.com.server.key -out api.transportjp.com.server.csr
// Ïò×Ô¼ºµÄ CA »ú¹¹ÉêÇëÖ¤Ê飬ǩÃû¹ý³ÌÐèÒª CA µÄÖ¤ÊéºÍ˽Կ²ÎÓ룬×îÖÕ°ä·¢Ò»¸ö´øÓÐ CA Ç©ÃûµÄÖ¤Êé
ÃüÁopenssl x509 -req -CA api.transportjp.com.ca.crt -CAkey api.transportjp.com.ca.key -CAcreateserial -in api.transportjp.com.server.csr -out api.transportjp.com.server.crt
//ʹÓÃopenssl ½øÐÐת»»
ÃüÁopenssl x509 -in api.transportjp.com.server.crt -out api.transportjp.com.server.cer -outform der
//version 2
openssl genrsa -des3 -out dev.apistore.transportjp.com.key 1024
openssl req -new -subj /C=CN/ST=AnHui/L=HeFei/O=iTranswarp/OU=iTranswarp/CN=dev.apistore.transportjp.com -key dev.apistore.transportjp.com.key -out dev.apistore.transportjp.com.csr
mv dev.apistore.transportjp.com.key dev.apistore.transportjp.com.origin.key
openssl rsa -in dev.apistore.transportjp.com.origin.key -out dev.apistore.transportjp.com.key
openssl x509 -req -days 3650 -in dev.apistore.transportjp.com.csr -signkey dev.apistore.transportjp.com.key -out dev.apistore.transportjp.com.crt
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile conf/ssl/server.crt
SSLCertificateKeyFile conf/ssl/server.key
SSLCertificateChainFile conf/ssl/ca.crt
</VirtualHost>
//°¢ÀïÔÆ´ÅÅÌÀ©ÈÝ
//https://help.aliyun.com/document_detail/25452.html?spm=5176.11065259.1996646101.searchclickresult.1db338f2uDGalg
//ÂÞÁдÅÅÌ
lsblk -f
ÖØÆô·þÎñÆ÷ºó
umount /dev/xvdb
fdisk -l ÂÞÁзÖÇøÐÅÏ¢²¢¼Ç¼À©ÈÝÇ°Êý¾ÝÅ̵Ä×îÖÕÈÝÁ¿¡¢ÆðʼÉÈÇø£¨First sector£©Î»ÖÃ
fdisk /dev/xvdb
d ²¢°´»Ø³µ¼ü£¬É¾³ýÔÀ´µÄ·ÖÇø
n ²¢°´»Ø³µ¼ü£¬¿ªÊ¼´´½¨ÐµķÖÇø
p ²¢°´»Ø³µ¼ü£¬Ñ¡Ôñ´´½¨Ö÷·ÖÇø
1 ´´½¨Ò»¸ö·ÖÇø£¬ËùÒÔÊäÈë 1
First sector ÐèÒªÓëÔÀ´µÄ·ÖÇø±£³ÖÒ»Ö¡£ÔÚ±¾Ê¾ÀýÖУ¬°´»Ø³µ¼ü²ÉÓÃĬÈÏÖµ
ÊäÈë×îºóÒ»¸öÉÈÇø±àºÅ£ºÒòΪÕâÀï½ö´´½¨Ò»¸ö·ÖÇø£¬ËùÒÔ°´»Ø³µ¼ü²ÉÓÃĬÈÏÖµ
ÊäÈë wq ²¢°´»Ø³µ¼ü£¬¿ªÊ¼·ÖÇø
e2fsck -f /dev/xvdb # ¼ì²éÎļþϵͳ
resize2fs /dev/xvdb # ±ä¸üÎļþϵͳ´óС
mount /dev/xvdb /transimg
# mount: you must specify the filesystem type
mkfs.ext3 /dev/vdb ¸ñʽ»¯
##ѹËõ
tar -cjf *.tar.bz2 Òª´ò°üµÄĿ¼»òÎļþ
##½âѹ
tar -jxvf xx.tar.bz2
tar zxvf pythontab.tar.gz
memcached -d -p 11211 -u memcached -m 64 -c 1024 -P -U 0 /var/run/memcached/memcached.pid -U 0
memcached -d -m 1024 -u root -l 127.0.0.1 -p 11211 -c 1024 -P /tmp/memcached.pid
# find
## 删除30天以外的文件
find /path -mtime +30 -type f -name \*.zip -exec rm -f {} \;
## 查找指定内容的文件
find . -type f -name "index.php" -exec grep -r -l "html" {} \;
###Á÷Á¿²é¿´
iftop -i eth1 -P
[rsync]
-a ²ÎÊý£¬Ï൱ÓÚ-rlptgoD£¬-r Êǵݹé -l ÊÇÁ´½ÓÎļþ£¬Òâ˼ÊÇ¿½±´Á´½ÓÎļþ£»-p ±íʾ±£³ÖÎļþÔÓÐȨÏÞ£»-t ±£³ÖÎļþÔÓÐʱ¼ä£»-g ±£³ÖÎļþÔÓÐÓû§×飻-o ±£³ÖÎļþÔÓÐÊôÖ÷£»-D Ï൱ÓÚ¿éÉ豸Îļþ£»
-z ´«ÊäʱѹËõ£»
-P ´«Êä½ø¶È£»
-v ´«ÊäʱµÄ½ø¶ÈµÈÐÅÏ¢£¬ºÍ-PÓеã¹Øϵ
rsync -avz --delete --exclude Application/Runtime/ userid@172.16.7.158::mokuai /var/www/html/rigouwang/ --password-file=/etc/rsyncd.pwd
rsync -r 172.16.10.5:/etc /tmp
rsync -av ԴĿ¼ Ä¿±êĿ¼
[inotifywait] ֻҪʹÓÃinotifywait¼ì²âµ½Ê¼þʱ£¬×Ô¶¯Ö´ÐÐrsync½øÐÐͬ²½²Ù×÷¼´¿É¡£¼ÓÉÏÖ´ÐÐȨÏÞ²¢ÔÚºǫ́ÔËÐм´¿É
#!/bin/bash
inotifywait -mrq -e create,close_write,move,delete,modify /var/www/html/ | while read a b c
do
rsync -azP --delete /var/www/html/ root@192.168.94.29:/backup(»òÕßrsync -azp /backup/ rsync_backup@192.168.94.29::backup --password-file=/et
c/rsync.password)
[rsync + inotifywait]
#!/bin/bash
src=/data/ # ÐèҪͬ²½µÄԴ·¾¶
des=data # Ä¿±ê·þÎñÆ÷ÉÏ rsync --daemon ·¢²¼µÄÃû³Æ£¬rsync --daemonÕâÀï¾Í²»×ö½éÉÜÁË£¬ÍøÉÏËÑһϣ¬±È½Ï¼òµ¥¡£
rsync_passwd_file=/etc/rsyncd.passwd # rsyncÑéÖ¤µÄÃÜÂëÎļþ
ip1=192.168.0.18 # Ä¿±ê·þÎñÆ÷1
ip2=192.168.0.19 # Ä¿±ê·þÎñÆ÷2
user=root # rsync --daemon¶¨ÒåµÄÑéÖ¤Óû§Ãû
cd ${src} # ´Ë·½·¨ÖУ¬ÓÉÓÚrsyncͬ²½µÄÌØÐÔ£¬ÕâÀï±ØÐëÒªÏÈcdµ½Ô´Ä¿Â¼£¬inotifyÔÙ¼àÌý ./ ²ÅÄÜrsyncͬ²½ºóĿ¼½á¹¹Ò»Ö£¬ÓÐÐËȤµÄͬѧ¿ÉÒÔ½øÐи÷ÖÖ³¢ÊÔ¹Û¿´ÆäЧ¹û
/usr/local/bin/inotifywait -mrq --format '%Xe %w%f' -e modify,create,delete,attrib,close_write,move ./ | while read file # °Ñ¼à¿Øµ½Óз¢Éú¸ü¸ÄµÄ"Îļþ·¾¶Áбí"Ñ»·
do
INO_EVENT=$(echo $file | awk '{print $1}') # °ÑinotifyÊä³öÇÐ¸î °ÑʼþÀàÐͲ¿·Ö¸³Öµ¸øINO_EVENT
INO_FILE=$(echo $file | awk '{print $2}') # °ÑinotifyÊä³öÇÐ¸î °ÑÎļþ·¾¶²¿·Ö¸³Öµ¸øINO_FILE
echo "-------------------------------$(date)------------------------------------"
echo $file
#Ôö¼Ó¡¢Ð޸ġ¢Ð´ÈëÍê³É¡¢Òƶ¯½øʼþ
#Ôö¡¢¸Ä·ÅÔÚͬһ¸öÅжϣ¬ÒòΪËûÃǶ¼¿Ï¶¨ÊÇÕë¶ÔÎļþµÄ²Ù×÷£¬¼´Ê¹ÊÇн¨Ä¿Â¼£¬ÒªÍ¬²½µÄÒ²Ö»ÊÇÒ»¸ö¿ÕĿ¼£¬²»»áÓ°ÏìËٶȡ£
if [[ $INO_EVENT =~ 'CREATE' ]] || [[ $INO_EVENT =~ 'MODIFY' ]] || [[ $INO_EVENT =~ 'CLOSE_WRITE' ]] || [[ $INO_EVENT =~ 'MOVED_TO' ]] # ÅжÏʼþÀàÐÍ
then
echo 'CREATE or MODIFY or CLOSE_WRITE or MOVED_TO'
rsync -avzcR --password-file=${rsync_passwd_file} $(dirname ${INO_FILE}) ${user}@${ip1}::${des} && # INO_FILE±äÁ¿´ú±í·¾¶Å¶ -cУÑéÎļþÄÚÈÝ
rsync -avzcR --password-file=${rsync_passwd_file} $(dirname ${INO_FILE}) ${user}@${ip2}::${des}
#×Ðϸ¿´ ÉÏÃæµÄrsyncͬ²½ÃüÁî Ô´ÊÇÓÃÁË$(dirname ${INO_FILE})±äÁ¿ ¼´Ã¿´ÎÖ»Õë¶ÔÐÔµÄͬ²½·¢Éú¸Ä±äµÄÎļþµÄĿ¼(ֻͬ²½Ä¿±êÎļþµÄ·½·¨ÔÚÉú²ú»·¾³µÄijЩ¼«¶Ë»·¾³Ï»á©Îļþ ÏÖÔÚ¿ÉÒÔÔÚ²»Â©ÎļþÏÂÒ²Óв»´íµÄËÙ¶È ×öµ½Æ½ºâ) È»ºóÓÃ-R²ÎÊý°ÑÔ´µÄĿ¼½á¹¹µÝ¹éµ½Ä¿±êºóÃæ ±£Ö¤Ä¿Â¼½á¹¹Ò»ÖÂÐÔ
fi
#ɾ³ý¡¢Òƶ¯³öʼþ
if [[ $INO_EVENT =~ 'DELETE' ]] || [[ $INO_EVENT =~ 'MOVED_FROM' ]]
then
echo 'DELETE or MOVED_FROM'
rsync -avzR --delete --password-file=${rsync_passwd_file} $(dirname ${INO_FILE}) ${user}@${ip1}::${des} &&
rsync -avzR --delete --password-file=${rsync_passwd_file} $(dirname ${INO_FILE}) ${user}@${ip2}::${des}
#¿´rsyncÃüÁî Èç¹ûÖ±½Óͬ²½ÒÑɾ³ýµÄ·¾¶${INO_FILE}»á±¨no such or directory´íÎó ËùÒÔÕâÀïͬ²½µÄÔ´ÊDZ»É¾Îļþ»òĿ¼µÄÉÏÒ»¼¶Â·¾¶£¬²¢¼ÓÉÏ--deleteÀ´É¾³ýÄ¿±êÉÏÓжøÔ´ÖÐûÓеÄÎļþ£¬ÕâÀï²»ÄÜ×öµ½Ö¸¶¨Îļþɾ³ý£¬Èç¹ûɾ³ýµÄ·¾¶Ô½¿¿½ü¸ù£¬Ôòͬ²½µÄĿ¼Ô¶࣬ͬ²½É¾³ýµÄ²Ù×÷¾ÍÔ½»¨Ê±¼ä¡£ÕâÀïÓиüºÃ·½·¨µÄͬѧ£¬»¶Ó½»Á÷¡£
fi
#ÐÞ¸ÄÊôÐÔʼþ Ö¸ touch chgrp chmod chownµÈ²Ù×÷
if [[ $INO_EVENT =~ 'ATTRIB' ]]
then
echo 'ATTRIB'
if [ ! -d "$INO_FILE" ] # Èç¹ûÐÞ¸ÄÊôÐÔµÄÊÇĿ¼ Ôò²»Í¬²½£¬ÒòΪͬ²½Ä¿Â¼»á·¢ÉúµÝ¹éɨÃ裬µÈ´ËĿ¼ÏµÄÎļþ·¢Éúͬ²½Ê±£¬rsync»á˳´ø¸üдËĿ¼¡£
then
rsync -avzcR --password-file=${rsync_passwd_file} $(dirname ${INO_FILE}) ${user}@${ip1}::${des} &&
rsync -avzcR --password-file=${rsync_passwd_file} $(dirname ${INO_FILE}) ${user}@${ip2}::${des}
fi
fi
done
crontab -e
* */2 * * * rsync -avz --password-file=/etc/rsync-client.pass /data/ root@192.168.0.18::data && rsync -avz --password-file=/etc/rsync-client.pass /data/ root@192.168.0.19::data
[scp]
scp work@192.168.0.10:/home/work/source.txt /home/work/
###php °²×°
ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
# ssl
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
certbot-auto certonly --text --agree-tos --webroot -w /usr/local/nginx/conf/ssl/ -d ds.ahmorewin.com
certbot --nginx -d ds.ahmorewin.com --agree-tos -n
sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot certonly --nginx
sudo certbot renew --dry-run
sudo certbot --nginx --nginx-server-root=/www/server/nginx/conf/
certbot certonly --nginx --nginx-server-root=/www/server/nginx/conf/ --email 353373021@qq.com -d dianshang.ahmorewin.com -d hailiang2.ahmorewin.com
## 检查网络是否正常
```
curl -4 -v https://acme-v02.api.letsencrypt.org/directory
curl -6 -v https://acme-v02.api.letsencrypt.org/directory
```
[extundelete] Îļþ»Ö¸´¹¤¾ß
extundelete /dev/vdb --inode 2
ls -id ²é¿´node
[shell]
path=$(cd `dirname $0`; pwd)
nohup mysql -uroot -pMJsujrctG6pU0OUG -h172.24.63.203 < $path/tao86_f_opij.sql 2>&1 &
[mount]
umount /dev/vdc
mount /dev/vdb /transimg
[dd]
dd if=/dev/vdc f=/dev/vdb
[centos 8]
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all && yum makecache
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.aliyuncs.com/repo/Centos-vault-8.5.2111.repo
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g' /etc/yum.repos.d/CentOS-Base.repo && sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/CentOS-Base.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/CentOS-Base.repo
yum clean all && yum makecache
rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo
wget http://mirrors.cloud.aliyuncs.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
wget http://mirrors.cloud.aliyuncs.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo
sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo
## git 用户
git:x:996:994::/var/opt/gitlab:/bin/sh
## openssh 秘钥转换 rsa
ssh-keygen -p -N "" -m pem -f /path/to/fil