shell脚本之监控系统的磁盘空间使用率

目录

一、脚本要求

二、检查本地系统环境

1.检查系统版本

2.检查系统内核版本

三、编写disk.sh脚本

1.创建脚本目录

2.编写disk.sh脚本

3.执行测试脚本

四、查看脚本执行日志文件

五、本次实践总结

1.脚本定时执行

2.实践总结


一、脚本要求

1.监控磁盘所有分区下的磁盘使用率。
2.磁盘使用率超过60%的提醒。
3.磁盘使用率超过80%的进行警告。
4.将执行结果写入到日志文件中。
5.显示每个分区的挂载目录下具体到二级目录的空间使用大小。
6.每天的凌晨左右定时执行该脚本。

二、检查本地系统环境

1.检查系统版本

[root@jeven ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)

2.检查系统内核版本

[root@jeven ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core) 

三、编写disk.sh脚本

1.创建脚本目录

[root@jeven ~]# mkdir -p /data/scripts
[root@jeven ~]# cd /data/scripts/
[root@jeven scripts]# ls

2.编写disk.sh脚本

[root@jeven scripts]# cat disk.sh 
#!/bin/bash
##########################################################
#File Name:disk.sh
#Version:V1.0
#Aurhor:jqzheng
#Emali:[email protected]
#Created Time:2023-02-14 14:36:26
#Description:
##########################################################

#监控系统磁盘空间余量不足的情况

############### 一、定义变量 ##########

DATE=$(date '+%m%d%y') #Date for report file 




############### 二、将脚本执行脚本导入日志文件 ############
exec > disk_space_$DATE.rpt #Make report file STDOUT 


############     三、检查磁盘空间使用率 ###########
echo "检查磁盘空间使用率"

while true
do
# 检查磁盘空间使用率
df -h | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 " " $6}' | while read output;
do
# 获取磁盘使用率
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
# 获取磁盘名称
partition=$(echo $output | awk '{ print $2 }' )
# 如果磁盘使用率大于80,发出警告
    if [ $usep -ge 60 ]; then
         echo "磁盘 $partition 使用率 $usep, 空间余量不足,请注意"
    elif [ $usep -ge 80 ];then
         echo "磁盘 $partition 使用率 $usep ,  空间余量严重不足,警告,请重点关注处理"
                    
    else
      echo " 磁盘 $partition $usep, 空间余量正常"
fi
done
# 休眠5秒
sleep 5

echo "####################Top Ten Disk Space Usage###############" #Report header

CHECK_DIRECTORIES=" $(df -h | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $6 }')"


#CHECK_DIRECTORIES=" /home "
for DIR_CHECK in $CHECK_DIRECTORIES #Loop to du directories 

do
 echo "" 
 echo "The $DIR_CHECK Directory:" #Directory header 
# 
# Create a listing of top ten disk space users in this dir 
 du -Sh $DIR_CHECK 2>/dev/null |
 sort -rn |
 sed '{11,$D; =}' |
 sed 'N; s/
/ /' |
 gawk '{printf $1 ":" "	" $2 "	" $3 "
"}'
# 
done #End of loop 
# 

exit
done

3.执行测试脚本

sh disk.sh

四、查看脚本执行日志文件

[root@jeven scripts]# cat disk_space_021423.rpt 
检查磁盘空间使用率
磁盘 /dev/mapper/centos-root 使用率 61, 空间余量不足,请注意
 磁盘 /dev/sda1 28, 空间余量正常
 磁盘 /dev/mapper/centos-home 4, 空间余量正常
磁盘 overlay 使用率 61, 空间余量不足,请注意
磁盘 overlay 使用率 61, 空间余量不足,请注意
磁盘 overlay 使用率 61, 空间余量不足,请注意
磁盘 overlay 使用率 61, 空间余量不足,请注意
磁盘 overlay 使用率 61, 空间余量不足,请注意
磁盘 overlay 使用率 61, 空间余量不足,请注意
磁盘 overlay 使用率 61, 空间余量不足,请注意
磁盘 overlay 使用率 61, 空间余量不足,请注意
####################Top Ten Disk Space Usage###############

The / Directory:
1:	1020K	/var/lib/docker/volumes/mdserver_mwserver/_data/server/mdserver-web/lib/python3.7/site-packages/setuptools
2:	1020K	/var/lib/docker/overlay2/fdb5c1435803d6627905be8774855fdc21fcdb127f9521ee3a7dfcd2d98af4b2/diff/www/server/php/56/src/ext/mbstring/oniguruma/.libs
3:	1020K	/var/lib/docker/overlay2/fdb5c1435803d6627905be8774855fdc21fcdb127f9521ee3a7dfcd2d98af4b2/diff/www/server/php/56/src/ext/dom/tests
4:	1020K	/var/lib/docker/overlay2/b740313edb580ccf0c6a524b9e20ccbeb74c925bb9c017e2593b51ccef481b18/diff/usr/lib64/security
5:	1020K	/var/lib/docker/overlay2/b5c3dca7e9d992cbda9e3f304b879ee111cf4f0f4180df398310e41d68240b61/diff/usr/share/locale/de/LC_MESSAGES
6:	1020K	/var/lib/docker/overlay2/ad1f361fe1a29d0e03a8c9989d42d3b808a4bc08387c74a693b42bb53cdae954/diff/usr/lib64/security
7:	1020K	/var/lib/docker/overlay2/9f0698a7d325a41c507fbec41baff44dfe512130661f9cc375a85436438ce1fd/diff/usr/share/webmin/sendmail
8:	1020K	/var/lib/docker/overlay2/85f6a9a570e44df839ac70b8a55f00db5263d43927bb1ad413640c808875310d/diff/www/server/mdserver-web/lib/python3.7/site-packages/setuptools
9:	1020K	/var/lib/docker/overlay2/85f6a9a570e44df839ac70b8a55f00db5263d43927bb1ad413640c808875310d/diff/usr/local/lib/python3.7/dist-packages/setuptools
10:	1020K	/var/lib/docker/overlay2/7f5bd5a9539fdaadb5e967e5cab3a6b5a5edb2f8ea2e5f0839a82d61b9a10e71/diff/var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/main/resources/help/de/search

The /boot Directory:
1:	230M	/boot
2:	16K	/boot/grub2
3:	5.9M	/boot/efi/EFI/centos
4:	4.0K	/boot/grub
5:	3.2M	/boot/grub2/locale
6:	2.5M	/boot/grub2/fonts
7:	2.4M	/boot/grub2/i386-pc
8:	1.9M	/boot/efi/EFI/BOOT
9:	0	/boot/efi/EFI/centos/fw
10:	0	/boot/efi/EFI

The /home Directory:
1:	16K	/home/zhangsan
2:	16K	/home/lisi
3:	16K	/home/kitty
4:	16K	/home/admin
5:	12K	/home/mysql
6:	4.0K	/home/zhangsan/.cache/abrt
7:	4.0K	/home/lisi/.cache/abrt
8:	4.0K	/home/kitty/.cache/abrt
9:	4.0K	/home/admin/.cache/abrt
10:	1.8M	/home/logs

The /var/lib/docker/overlay2/a94945be09e1096d9b4ed38cd85c2d0ae53f12e3ba513b39bc18cb19d1ed3ac5/merged Directory:
1:	812K	/var/lib/docker/overlay2/a94945be09e1096d9b4ed38cd85c2d0ae53f12e3ba513b39bc18cb19d1ed3ac5/merged/bin
2:	416K	/var/lib/docker/overlay2/a94945be09e1096d9b4ed38cd85c2d0ae53f12e3ba513b39bc18cb19d1ed3ac5/merged/usr/share/zoneinfo/right/America
3:	408K	/var/lib/docker/overlay2/a94945be09e1096d9b4ed38cd85c2d0ae53f12e3ba513b39bc18cb19d1ed3ac5/merged/usr/share/zoneinfo/America
4:	312K	/var/lib/docker/overlay2/a94945be09e1096d9b4ed38cd85c2d0ae53f12e3ba513b39bc18cb19d1ed3ac5/merged/usr/share/zoneinfo/right/Asia
5:	312K	/var/lib/docker/overlay2/a94945be09e1096d9b4ed38cd85c2d0ae53f12e3ba513b39bc18cb19d1ed3ac5/merged/usr/share/zoneinfo/Asia
6:	236K	/var/lib/docker/overlay2/a94945be09e1096d9b4ed38cd85c2d0ae53f12e3ba513b39bc18cb19d1ed3ac5/merged/usr/bin
7:	212K	/var/lib/docker/overlay2/a94945be09e1096d9b4ed38cd85c2d0ae53f12e3ba513b39bc18cb19d1ed3ac5/merged/etc/ssl/certs
8:	180K	/var/lib/docker/overlay2/a94945be09e1096d9b4ed38cd85c2d0ae53f12e3ba513b39bc18cb19d1ed3ac5/merged/usr/share/zoneinfo/right/Europe
9:	176K	/var/lib/docker/overlay2/a94945be09e1096d9b4ed38cd85c2d0ae53f12e3ba513b39bc18cb19d1ed3ac5/merged/usr/share/zoneinfo/Europe
10:	128K	/var/lib/docker/overlay2/a94945be09e1096d9b4ed38cd85c2d0ae53f12e3ba513b39bc18cb19d1ed3ac5/merged/usr/share/zoneinfo/right/Pacific

The /var/lib/docker/overlay2/cb621998f9d60251005de37746ad79805eb1b084fe5cdfcf48426b0c6fdc3f63/merged Directory:
1:	996K	/var/lib/docker/overlay2/cb621998f9d60251005de37746ad79805eb1b084fe5cdfcf48426b0c6fdc3f63/merged/usr/lib/x86_64-linux-gnu/security
2:	972K	/var/lib/docker/overlay2/cb621998f9d60251005de37746ad79805eb1b084fe5cdfcf48426b0c6fdc3f63/merged/usr/lib/x86_64-linux-gnu/perl/5.30.0
3:	880K	/var/lib/docker/overlay2/cb621998f9d60251005de37746ad79805eb1b084fe5cdfcf48426b0c6fdc3f63/merged/usr/lib/apt/methods
4:	876K	/var/lib/docker/overlay2/cb621998f9d60251005de37746ad79805eb1b084fe5cdfcf48426b0c6fdc3f63/merged/usr/share/perl/5.30.0/Module
5:	764K	/var/lib/docker/overlay2/cb621998f9d60251005de37746ad79805eb1b084fe5cdfcf48426b0c6fdc3f63/merged/usr/share/perl/5.30.0/ExtUtils
6:	760K	/var/lib/docker/overlay2/cb621998f9d60251005de37746ad79805eb1b084fe5cdfcf48426b0c6fdc3f63/merged/usr/share/info
7:	708K	/var/lib/docker/overlay2/cb621998f9d60251005de37746ad79805eb1b084fe5cdfcf48426b0c6fdc3f63/merged/usr/lib/gnupg
8:	604K	/var/lib/docker/overlay2/cb621998f9d60251005de37746ad79805eb1b084fe5cdfcf48426b0c6fdc3f63/merged/usr/share/perl/5.30.0/CPAN
9:	600K	/var/lib/docker/overlay2/cb621998f9d60251005de37746ad79805eb1b084fe5cdfcf48426b0c6fdc3f63/merged/var/log
10:	584K	/var/lib/docker/overlay2/cb621998f9d60251005de37746ad79805eb1b084fe5cdfcf48426b0c6fdc3f63/merged/usr/lib/x86_64-linux-gnu/perl-base/auto/re

The /var/lib/docker/overlay2/dfca408bfa479063200e98a306c4fe95d88b183b52e406dcfd46f21f0eeadc86/merged Directory:
1:	1000K	/var/lib/docker/overlay2/dfca408bfa479063200e98a306c4fe95d88b183b52e406dcfd46f21f0eeadc86/merged/usr/lib/apt/methods
2:	988K	/var/lib/docker/overlay2/dfca408bfa479063200e98a306c4fe95d88b183b52e406dcfd46f21f0eeadc86/merged/usr/src/php/ext/standard/tests/misc
3:	984K	/var/lib/docker/overlay2/dfca408bfa479063200e98a306c4fe95d88b183b52e406dcfd46f21f0eeadc86/merged/usr/lib/x86_64-linux-gnu/perl/5.32.1
4:	972K	/var/lib/docker/overlay2/dfca408bfa479063200e98a306c4fe95d88b183b52e406dcfd46f21f0eeadc86/merged/usr/share/perl/5.32.1/Module
5:	944K	/var/lib/docker/overlay2/dfca408bfa479063200e98a306c4fe95d88b183b52e406dcfd46f21f0eeadc86/merged/usr/include/x86_64-linux-gnu/bits
6:	940K	/var/lib/docker/overlay2/dfca408bfa479063200e98a306c4fe95d88b183b52e406dcfd46f21f0eeadc86/merged/usr/src/php/ext/openssl/tests
7:	916K	/var/lib/docker/overlay2/dfca408bfa479063200e98a306c4fe95d88b183b52e406dcfd46f21f0eeadc86/merged/usr/src/php/ext/mysqlnd
8:	916K	/var/lib/docker/overlay2/dfca408bfa479063200e98a306c4fe95d88b183b52e406dcfd46f21f0eeadc86/merged/usr/local/lib/php/build
9:	912K	/var/lib/docker/overlay2/dfca408bfa479063200e98a306c4fe95d88b183b52e406dcfd46f21f0eeadc86/merged/usr/include/c++/10/ext
10:	904K	/var/lib/docker/overlay2/dfca408bfa479063200e98a306c4fe95d88b183b52e406dcfd46f21f0eeadc86/merged/usr/share/vim/vim82/indent

The /var/lib/docker/overlay2/ce85b9a8f1ac977e52543f5c96258ca1c2bd04126cfd89b35898a3abd4fe762f/merged Directory:
1:	1012K	/var/lib/docker/overlay2/ce85b9a8f1ac977e52543f5c96258ca1c2bd04126cfd89b35898a3abd4fe762f/merged/tmp/.jodconverter_socket_host-127.0.0.1_port-2002/user/database/biblio
2:	1012K	/var/lib/docker/overlay2/ce85b9a8f1ac977e52543f5c96258ca1c2bd04126cfd89b35898a3abd4fe762f/merged/tmp/.jodconverter_socket_host-127.0.0.1_port-2001/user/database/biblio
3:	1012K	/var/lib/docker/overlay2/ce85b9a8f1ac977e52543f5c96258ca1c2bd04126cfd89b35898a3abd4fe762f/merged/opt/libreoffice7.1/program/types
4:	1012K	/var/lib/docker/overlay2/ce85b9a8f1ac977e52543f5c96258ca1c2bd04126cfd89b35898a3abd4fe762f/merged/opt/libreoffice7.1/presets/database/biblio
5:	976K	/var/lib/docker/overlay2/ce85b9a8f1ac977e52543f5c96258ca1c2bd04126cfd89b35898a3abd4fe762f/merged/opt/libreoffice7.1/share/xslt/export/uof
6:	968K	/var/lib/docker/overlay2/ce85b9a8f1ac977e52543f5c96258ca1c2bd04126cfd89b35898a3abd4fe762f/merged/opt/libreoffice7.1/share/extensions/nlpsolver/locale
7:	964K	/var/lib/docker/overlay2/ce85b9a8f1ac977e52543f5c96258ca1c2bd04126cfd89b35898a3abd4fe762f/merged/usr/lib/x86_64-linux-gnu/security
8:	956K	/var/lib/docker/overlay2/ce85b9a8f1ac977e52543f5c96258ca1c2bd04126cfd89b35898a3abd4fe762f/merged/usr/lib/python3/dist-packages
9:	956K	/var/lib/docker/overlay2/ce85b9a8f1ac977e52543f5c96258ca1c2bd04126cfd89b35898a3abd4fe762f/merged/opt/libreoffice7.1/share/Scripts/python/LibreLogo
10:	956K	/var/lib/docker/overlay2/ce85b9a8f1ac977e52543f5c96258ca1c2bd04126cfd89b35898a3abd4fe762f/merged/opt/libreoffice7.1/share/extensions/wiki-publisher

The /var/lib/docker/overlay2/2e9e3d5b6b64a0feb0459b598e678a34fc830d05a006efe75169b7ffe0b97fdc/merged Directory:
1:	996K	/var/lib/docker/overlay2/2e9e3d5b6b64a0feb0459b598e678a34fc830d05a006efe75169b7ffe0b97fdc/merged/usr/lib/apt/methods
2:	984K	/var/lib/docker/overlay2/2e9e3d5b6b64a0feb0459b598e678a34fc830d05a006efe75169b7ffe0b97fdc/merged/usr/lib/x86_64-linux-gnu/perl/5.32.1
3:	972K	/var/lib/docker/overlay2/2e9e3d5b6b64a0feb0459b598e678a34fc830d05a006efe75169b7ffe0b97fdc/merged/usr/share/perl/5.32.1/Module
4:	972K	/var/lib/docker/overlay2/2e9e3d5b6b64a0feb0459b598e678a34fc830d05a006efe75169b7ffe0b97fdc/merged/usr/local/include/node
5:	868K	/var/lib/docker/overlay2/2e9e3d5b6b64a0feb0459b598e678a34fc830d05a006efe75169b7ffe0b97fdc/merged/root/.npm/_cacache/content-v2/sha512/9f/7d
6:	840K	/var/lib/docker/overlay2/2e9e3d5b6b64a0feb0459b598e678a34fc830d05a006efe75169b7ffe0b97fdc/merged/usr/local/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/openssl
7:	840K	/var/lib/docker/overlay2/2e9e3d5b6b64a0feb0459b598e678a34fc830d05a006efe75169b7ffe0b97fdc/merged/usr/local/include/node/openssl/archs/VC-WIN64A/no-asm/include/openssl
8:	840K	/var/lib/docker/overlay2/2e9e3d5b6b64a0feb0459b598e678a34fc830d05a006efe75169b7ffe0b97fdc/merged/usr/local/include/node/openssl/archs/VC-WIN64A/asm/include/openssl
9:	840K	/var/lib/docker/overlay2/2e9e3d5b6b64a0feb0459b598e678a34fc830d05a006efe75169b7ffe0b97fdc/merged/usr/local/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/openssl
10:	840K	/var/lib/docker/overlay2/2e9e3d5b6b64a0feb0459b598e678a34fc830d05a006efe75169b7ffe0b97fdc/merged/usr/local/include/node/openssl/archs/VC-WIN32/no-asm/include/openssl

The /var/lib/docker/overlay2/1d1b975e292987a2ac03016cec8b7dd395685ef84fe5046b71dd1ed0152c04cc/merged Directory:
1:	1016K	/var/lib/docker/overlay2/1d1b975e292987a2ac03016cec8b7dd395685ef84fe5046b71dd1ed0152c04cc/merged/var/www/onlyoffice/documentserver/dictionaries/lb_LU
2:	1016K	/var/lib/docker/overlay2/1d1b975e292987a2ac03016cec8b7dd395685ef84fe5046b71dd1ed0152c04cc/merged/usr/share/icons/ubuntu-mono-light/status/24
3:	1004K	/var/lib/docker/overlay2/1d1b975e292987a2ac03016cec8b7dd395685ef84fe5046b71dd1ed0152c04cc/merged/var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/main/resources/help/de/images/interface
4:	992K	/var/lib/docker/overlay2/1d1b975e292987a2ac03016cec8b7dd395685ef84fe5046b71dd1ed0152c04cc/merged/var/www/onlyoffice/documentserver/core-fonts/kacst
5:	992K	/var/lib/docker/overlay2/1d1b975e292987a2ac03016cec8b7dd395685ef84fe5046b71dd1ed0152c04cc/merged/usr/share/icons/Humanity/apps/24
6:	992K	/var/lib/docker/overlay2/1d1b975e292987a2ac03016cec8b7dd395685ef84fe5046b71dd1ed0152c04cc/merged/usr/include/boost/fusion/container/map/detail/cpp03/preprocessed
7:	988K	/var/lib/docker/overlay2/1d1b975e292987a2ac03016cec8b7dd395685ef84fe5046b71dd1ed0152c04cc/merged/usr/share/icons/ubuntu-mono-light/status/16
8:	984K	/var/lib/docker/overlay2/1d1b975e292987a2ac03016cec8b7dd395685ef84fe5046b71dd1ed0152c04cc/merged/var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/main/resources/help/en/UsageInstructions
9:	984K	/var/lib/docker/overlay2/1d1b975e292987a2ac03016cec8b7dd395685ef84fe5046b71dd1ed0152c04cc/merged/var/backups
10:	980K	/var/lib/docker/overlay2/1d1b975e292987a2ac03016cec8b7dd395685ef84fe5046b71dd1ed0152c04cc/merged/usr/lib/x86_64-linux-gnu/perl/5.30.0

The /var/lib/docker/overlay2/1c77eb5658ab9bf176fb9c6b4e8c1aba31cfee5901a1de52397112f3fba368ef/merged Directory:
1:	1000K	/var/lib/docker/overlay2/1c77eb5658ab9bf176fb9c6b4e8c1aba31cfee5901a1de52397112f3fba368ef/merged/usr/local/tomcat/webapps.dist/docs/config
2:	972K	/var/lib/docker/overlay2/1c77eb5658ab9bf176fb9c6b4e8c1aba31cfee5901a1de52397112f3fba368ef/merged/usr/local/tomcat/webapps/draw/math/extensions/a11y
3:	964K	/var/lib/docker/overlay2/1c77eb5658ab9bf176fb9c6b4e8c1aba31cfee5901a1de52397112f3fba368ef/merged/usr/lib/x86_64-linux-gnu/security
4:	928K	/var/lib/docker/overlay2/1c77eb5658ab9bf176fb9c6b4e8c1aba31cfee5901a1de52397112f3fba368ef/merged/usr/lib/python3/dist-packages/cryptography/hazmat/bindings
5:	880K	/var/lib/docker/overlay2/1c77eb5658ab9bf176fb9c6b4e8c1aba31cfee5901a1de52397112f3fba368ef/merged/usr/lib/apt/methods
6:	876K	/var/lib/docker/overlay2/1c77eb5658ab9bf176fb9c6b4e8c1aba31cfee5901a1de52397112f3fba368ef/merged/usr/local/tomcat/webapps/draw/js/mermaid
7:	852K	/var/lib/docker/overlay2/1c77eb5658ab9bf176fb9c6b4e8c1aba31cfee5901a1de52397112f3fba368ef/merged/usr/local/tomcat/webapps/draw/js/diagramly/vsdx
8:	748K	/var/lib/docker/overlay2/1c77eb5658ab9bf176fb9c6b4e8c1aba31cfee5901a1de52397112f3fba368ef/merged/usr/local/tomcat/webapps/draw/mxgraph
9:	748K	/var/lib/docker/overlay2/1c77eb5658ab9bf176fb9c6b4e8c1aba31cfee5901a1de52397112f3fba368ef/merged/usr/lib/python3/dist-packages/setuptools
10:	724K	/var/lib/docker/overlay2/1c77eb5658ab9bf176fb9c6b4e8c1aba31cfee5901a1de52397112f3fba368ef/merged/usr/local/tomcat/webapps/draw/img/people

The /var/lib/docker/overlay2/d4df4d6e2f8d9c3a0d4d0d6cb9f41cd10a562c3589223c5cda5b2c2a7ec3f20a/merged Directory:
1:	812K	/var/lib/docker/overlay2/d4df4d6e2f8d9c3a0d4d0d6cb9f41cd10a562c3589223c5cda5b2c2a7ec3f20a/merged/bin
2:	560K	/var/lib/docker/overlay2/d4df4d6e2f8d9c3a0d4d0d6cb9f41cd10a562c3589223c5cda5b2c2a7ec3f20a/merged/usr/share/ca-certificates/mozilla
3:	416K	/var/lib/docker/overlay2/d4df4d6e2f8d9c3a0d4d0d6cb9f41cd10a562c3589223c5cda5b2c2a7ec3f20a/merged/usr/share/zoneinfo/right/America
4:	408K	/var/lib/docker/overlay2/d4df4d6e2f8d9c3a0d4d0d6cb9f41cd10a562c3589223c5cda5b2c2a7ec3f20a/merged/usr/share/zoneinfo/America
5:	312K	/var/lib/docker/overlay2/d4df4d6e2f8d9c3a0d4d0d6cb9f41cd10a562c3589223c5cda5b2c2a7ec3f20a/merged/usr/share/zoneinfo/right/Asia
6:	312K	/var/lib/docker/overlay2/d4df4d6e2f8d9c3a0d4d0d6cb9f41cd10a562c3589223c5cda5b2c2a7ec3f20a/merged/usr/share/zoneinfo/Asia
7:	228K	/var/lib/docker/overlay2/d4df4d6e2f8d9c3a0d4d0d6cb9f41cd10a562c3589223c5cda5b2c2a7ec3f20a/merged/etc/ssl/certs
8:	180K	/var/lib/docker/overlay2/d4df4d6e2f8d9c3a0d4d0d6cb9f41cd10a562c3589223c5cda5b2c2a7ec3f20a/merged/usr/share/zoneinfo/right/Europe
9:	176K	/var/lib/docker/overlay2/d4df4d6e2f8d9c3a0d4d0d6cb9f41cd10a562c3589223c5cda5b2c2a7ec3f20a/merged/usr/share/zoneinfo/Europe
10:	128K	/var/lib/docker/overlay2/d4df4d6e2f8d9c3a0d4d0d6cb9f41cd10a562c3589223c5cda5b2c2a7ec3f20a/merged/usr/share/zoneinfo/right/Pacific


五、本次实践总结

1.脚本定时执行

[root@jeven scripts]# crontab -l
01 0 * * * sh /data/scripts/disk.sh

2.实践总结

1.可根据自身实际状况修改脚本内容。
2.可不断优化脚本内容,达到更加理想的效果。
3.运行脚本前,需提前多次测试脚本是否正常,满足功能需求。