自学内容网 自学内容网

RHEL---定时发布邮件

请添加图片描述
挂载磁盘

[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 identity

This 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.rc

set 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

结果请添加图片描述


原文地址:https://blog.csdn.net/2201_75364744/article/details/143019716

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!