Repository navigation
Expand file tree
/
Copy pathCode_Dump
More file actions
157 lines (112 loc) · 9.54 KB
/
Copy pathCode_Dump
File metadata and controls
157 lines (112 loc) · 9.54 KB
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
@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@
@@ DISK ALERTS @@
@@@@@@@@@@@@@@@@@@@@@@@@@@
##########################
##### Home Alerts #####
##########################
/bin/ls -A /var/cpanel/users |xargs -n1 -I{} sudo find /home/{}/public_html/ -type f -max-depth 3 -name '*error_log' -size +10M > testt.txt; while read file; do truncate -s 2 "$file"; done < testt.txt ; rm -f testt.txt; echo -e "\n------------\n"; df -h | grep home #### OLD COMMND
ls -A /var/cpanel/users |xargs -n1 -I{} sudo du -sh /home/{}/public_html/error_log 2> /dev/null |xargs truncate -s 1 ; echo -e "\n------------\n"; df -h | grep home ; echo -e "\n------------\n"; ls -A /var/cpanel/users |xargs -n1 -I{} sudo find /home{1..4}/{}/public_html/wp-content/updraft/ -maxdepth 1 -type f \( -name '*-uploads*.zip*' -o -name '*-others*.zip*' -o -name '*-plugins*.zip*' \) -print 2>/dev/null | grep -v "uploads.zip\|uploads.php\|others.zip\|others.php\|plugins.zip\|plugins.php" | xargs rm -vf ; echo -e "\n------------\n"; df -h | grep home;ls -A /var/cpanel/users |xargs -n1 -I{} sudo find /home{1..4}/{}/public_html/wp-content/uploads/ -maxdepth 2 -type f -name '*.zip.*' -print 2>/dev/null | xargs rm -vf;ls -A /var/cpanel/users |xargs -n1 -I{} sudo find /home{1..4}/{}/public_html/ -maxdepth 4 -type f \( -name '*-uploads*.zip*' -o -name '*-others*.zip*' -o -name '*-plugins*.zip*' \) -print 2>/dev/null | grep -v "uploads.zip\|uploads.php\|others.zip\|others.php\|plugins.zip\|plugins.php"| xargs rm -vf ; df -h | grep home
using Du
++++++++++
du -sm /home/*/public_html/error_log|awk '$1 > 50''{print $2}'|xargs -I{} truncate -s 1K {};
du -sm /home/*/public_html/*/error_log|awk '$1 > 50''{print $2}'|xargs -I{} truncate -s 1K {};
du -sm /home/*/public_html/*/*/error_log|awk '$1 > 50''{print $2}'|xargs -I{} truncate -s 1K {};
for hm in $(sqlite3 /var/lib/eig/dc/plugins "select distinct(root) from plugins" ) ;do find $hm -maxdepth 4 -name "*.wpress" -size +200M ;done
using Find
++++++++++
find /home/*/public_html/ -maxdepth 3 -type f -name '*error_log' -size +10M 2>/dev/null |xargs truncate -s 1;
###ls -A /var/cpanel/users |xargs -n1 -I{} sudo find /home{1..4}/{}/Backuparchives/ -maxdepth 1 -type f -name '*.j0*' -print 2>/dev/null ;
montool homediskusage
du -lh ~user| grep [0-9]G
tail -20 /var/cpanel/accounting.log ; grep diskclean /opt/hgmods/monitoring/logs/montool.log ; montool homediskusage ; screen -S DiskClean -d -m -- /root/bin/montool diskclean -d -a -p 90
screen -S chomex
find /home4/*/ -type d \( -name *updraft\* -or -name *backup\* -or -name *Backup\* \) -exec du -lh {} \; | grep [0-9]G | grep -v eig | sort -rh > /ramdisk/homx.txt
screen -S c1home1
find /homeX/*/ -type d \( -name *updraft\* -or -name *backup\* -or -name *Backup\* -or -name *migration\* -or -name *old\* -or -name *Old\* -or -name *bak\* \) -exec du -lh {} \; | grep [0-9]G | grep -v eig | sort -rh > /ramdisk/homX.txt
screen -S c1lear
find /home4 -name '**' -size +200M > /ramdisk/clear.txt
find -name '*uploads*' | grep -v 'uploads.zip\|uploads.php'| xargs rm -fv ; find -name '*others*' | grep -v 'others.zip\|others.php' | xargs rm -vf ; find -name '*plugins*' | grep -v 'plugins.zip\|pluginSs.php' | xargs rm -vf
find -name 'log.*' | xargs rm -f
for file in /path/sess_*; do rm -rfv "$file"; done
du -k | sort -n | perl -ne 'if ( /^(\d+)\s+(.*$)/){$l=log($1+.1);$m=int($l/log(1024)); printf ("%6.1f\t%s\t%25s %s\n",($1/(2**(10*$m))),(("K","M","G","T","P")[$m]),"*"x (1.5*$l),$2);}'
screen -ls | grep -e 'c1' -e 'cho'| awk '{print $1}' | xargs -I % -t screen -X -S % quit ; find /ramdisk | grep -e '.txt' -e 'clear.txt' | xargs rm -f ; service zabbix-agent restart; df -lh| grep /home
service zabbix-agent restart ;sleep 5s ;service zabbix-agent restart; exit
screen -S DiskClean -d -m -- /root/bin/montool diskclean -d -a -p 90 ;screen -ls ; exit
cd $(ls -d */ |sed -n '3p') ### Enter into Special type folder
##########################
##### /var / Alerts #####
##########################
/bin/ls -A /var/cpanel/users |xargs -n1 -I{} sudo du -sh /home/{}/public_html/error_log 2> /dev/null |grep G ; df -h| grep /var; w;screen -ls; history | grep scan.
lsof | grep "/var" | grep deleted ; ls -lhSr /var/log/domlogs | tail ; screen -S c1lear
find /var/lib/puppet/clientbucket/* -type f -mtime +30 -atime +30 -delete -print ;/scripts/clear_orphaned_virtfs_mounts --clearall ;logrotate -vf /etc/logrotate.conf; sleep 10s; logrotate -vf /etc/logrotate.conf; find /var/log/domlogs -maxdepth 1 -size +1M -exec truncate -s 1k {} + ; find /tmp -printf "%u %s\n" 2>/dev/null |perl -lane '$user{$F[0]} += $F[1]; END { printf "%.02fM $_\n", $user{$_}/1024/1024 for sort { $user{$a} <=> $user{$b} } keys %user }' ; find /tmp -name 'magick*' -delete ; find /tmp -name 'sess_*' -delete ; service zabbix-agent restart ; df -lh
du -hx --max-depth=8 /|grep [0-9]G
du -hx --max-depth=3 / | awk '($1 ~ /G/) && ($2 !~ /virtfs/) {print $0};'
du -xh / |grep '^\S*[0-9\.]\+G'|sort -rn
du -xh --max-depth=1 --exclude="fake" |sort -rh
find . -path ./fake -prune -o -type f -size +300M -exec ls -lh {} \; 2>/dev/null |awk '{print $5, $9, $10,$11,$12}' |sort -h
find /var/cpanel/horde/tmp/ -name impatt\* -delete
find /var -size +100M -exec ls {} + > /ramdisk/clear.txt
find /var/log/domlogs -maxdepth 1 -size +10M -exec truncate -s 5M {} +
find -type f -size +10M | xargs truncate --size 1M
screen -ls | grep -e 'c1' -e 'cho'| awk '{print $1}' | xargs -I % -t screen -X -S % quit ; find /ramdisk | grep -e '.txt' -e 'clear.txt' | xargs rm -f ; service zabbix-agent restart; df -lh| grep /var
find /var/lib/puppet/clientbucket/* -type f -mtime +30 -atime +30 -delete -print ### Clearing Puppet Logs
ln -s /homeX/user/mailman_archives/fdsfsd.mbox/ /usr/local/cpanel/3rdparty/mailman/archives/private/
tmpwatch --mtime --all 744 /usr/local/cpanel/3rdparty/mailman/archives/private/@listname_clientdomain@/attachments ### Clearing Mailman archives
ln -s
##########################
##### TMP Alerts #####
##########################
find /tmp -name 'magick*' -delete ; find /tmp -name 'sess_*' -delete ; service zabbix-agent restart ;sleep 10s ; service zabbix-agent restart; df -lh| grep /tmp
####################################################
##### Backup resize & Backup Not run/Post log #####
####################################################
ssh -i /admin/hgbackupdir/backupkey root@'df -h | grep backup | head -1 | cut -d : -f1'
df -h | egrep "(100%|9[0-9]%)"
vgs ; pvs
exportfs -a ; maint status
screen -S resize
df -h| grep
ps aux | grep
/opt/eig_linux/bin/resize_volume -p ###SRVpartion### -s 0.2
service zabbix-agent restart ; df -h| grep /backup
ps faux|grep backup|awk '{print $2}' | xargs kill -9
backuphelper reseed // backuphelper reset_queue
##############################
##### Inode/Quota Alerts #####
##############################
repquota -a| grep user
setquota -u user ### Both used fro set inode/Disk quota
edquota -u user
quota -suv user
find /var/cpanel/php/sessions/ea-*/ -name sess\* -mtime +10 -delete
cat /usr/local/eig_zabbix/tmp/zabbix_inode_abuse
for i in $(cat /usr/local/eig_zabbix/tmp/zabbix_inode_abuse|awk '{print $1}');do find /home/$i/mail/ -maxdepth 4 -type f -name "*vsize.lock*" -delete -print;done;service zabbix-agent restart ;sleep 5s ;service zabbix-agent restart; exit
clear;echo -e "\n`hostname`";for i in $(cat /usr/local/eig_zabbix/tmp/zabbix_inode_abuse|awk '{print $1}');do echo -ne "\nDovecot-vsize.lock(Count) $i :: " ; find /home/$i/mail/ -maxdepth 4 -type f -name "*vsize*"|wc -l && echo -e "\t Files Creation Time Frame :: $(find /home/$i/mail/ -maxdepth 4 -type f -name "*vsize*" -ls | head -1 | awk '{print $8,$9,$10}') -- $(find /home/$i/mail/ -maxdepth 4 -type f -name "*vsize*" -ls | head -50000| tail -1 | awk '{print $8,$9,$10}')";done;echo -e "\n================================================================================\n"
for i in $(cat /usr/local/eig_zabbix/tmp/zabbix_inode_abuse|awk '{print $1}');do inodes /home/$i ;echo "$i";grep -c "dovecot-vsize" /home/$i/mail/*/*;find /home/$i/*/cache/object/ -type f -print ;find /home/$i/mail/ -maxdepth 4 -type f -name "*vsize*" -print;done
awk '/Feb 4 01:30:00/,/Feb 4 02:30:00/' /var/log/maillog | grep -C10 -m5 Read
@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ @@
@@ SERVICE ALERTS @@
@@@@@@@@@@@@@@@@@@@@@@@@@@
service fail2ban status ; service fail2ban restart ; service zabbix-agent restart ;service fail2ban status
service fail2ban stop ; sleep 10s ; ps faux|grep fail2ban |awk '{print $2}' | xargs kill -9 ;sleep 10s ; service fail2ban restart ; service zabbix-agent restart ;service fail2ban status ; ps faux|grep fail2ban
service exim stop;exiqgrep -i|xargs exim -Mrm; service exim start
======================================================================
======================================================================
baremetal boxes
----------------
box7, box8
clou boxes
----------------
box 3,4
find out instances >> virsh list --all
reset >> virsh reset instance_id
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
https://www.redhat.com/en/engage/do101-introduction-openshift-s-202004060642
http://free.aicte-india.org/
https://smyl.es/complete-full-list-of-cpanel-scripts-under-the-scripts-directory/
https://www.thecpaneladmin.com/safely-removing-virtfs-on-a-cpanel-server/
==============================================================================================================
==============================================================================================================
==============================================================================================================