挂载磁盘
[root@localhost zzy]# mount /dev/sr0 /mnt
mount: /mnt: /dev/sr0 already mounted on /run/media/zzy/RHEL-9-3-0-BaseOS-x86_64.
下载邮件工具
[root@localhost zzy]# cat /etc/yum.repos.d/base.repo
[BaseOS]
name=BaseOS
baseurl=file:///mnt/BaseOS
gpgcheck=0[AppStream]
name=AppStream
baseurl=file:///mnt/AppStream
gpgcheck=0[root@localhost zzy]# dnf install s-nail -y
Updating Subscription Management repositories.
Unable to read consumer identityThis system is not registered with an entitlement server. You can use subscription-manager to register.BaseOS 2.7 MB/s | 2.7 kB 00:00
AppStream 3.1 MB/s | 3.2 kB 00:00
Package s-nail-14.9.22-6.el9.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete![root@localhost zzy]# tail -5 | /etc/s-nail.rcset from=15305218527@163.com
set smtp=smtp.163.com
set smtp-auth-user=15305218527@163.com
set smtp-auth-password=GEcgtf9Eaf3Mg8eg
set smtp-auth=login
[root@localhost zzy]#
编写定时邮件
[root@localhost zzy]# crontab -e
crontab: installing new crontab
[root@localhost zzy]# crontab -l
9 15 * * * echo ww | mail -s nn 15305218527@163.com
结果