当前位置:网站首页>Mail Informer
Mail Informer
2022-07-22 09:04:00 【WILL-678】
Mail Informer
前言
最近在用服务器跑MIT 6.824的测试代码,由于不能时刻在电脑旁,所以想在服务器上自动发邮件通知测试进度。
1.Linux Mail配置
Linux 使用命令发送邮件 | 菜鸟教程 (runoob.com)
1.安装mailx
yum install mailx -y
2.配置/etc/mail.rc
添加下面配置内容:
set from=[邮箱地址]
set smtp=smtp.163.com
set smtp-auth-user=[邮箱用户]
set smtp-auth-password=[邮箱密码]
set smtp-auth=login
对于163邮箱,可以通过设置->POP3/SMTP/IMAP->授权密码管理->新增授权密码
查看密码【注:网页登录的密码不可用】。
3.测试
运行下列命令,查看邮件是否发送成功。
echo 'hello world' | mail -s "test" [email protected]
2.定时脚本
执行的脚本:在**$3**进程存在的情况下,发送最近的10个结果至指定邮箱。
#!/bin/bash
ps -ef | grep $3 | grep -v grep > /dev/null #查看执行的进程是否存在
if [ $? == 0 ];
then
tail -n 10 $1 | mail -s "go test -run 2D" $2
fi
设置定时任务:七月的每个小时执行该脚本。
7 * * 7 * /root/MIT-6.824/src/raft/crontab.sh /root/MIT-6.824/src/raft/nohup.out [email protected] 20728
3.测试
边栏推荐
- 力扣解法汇总729-我的日程安排表 I
- 女嘉宾报名
- Yunyuanyuan (10) | introduction to kubernetes in kubernetes
- "Review of software engineering in Wuhan University of technology" Chapter 6 | coding specification
- Codeforces Round #806 (Div. 4)(7/7)
- Understand relevant concepts of prosody. XMPP, jabber, bosh, etc
- C#入门系列(二十七) -- LINQ简析
- 包装类和字符串的方法
- Reentrant function
- Visual studio debugging shortcut key
猜你喜欢
随机推荐
女嘉賓報名
主动降噪耳机排行榜10强,主动降噪耳机十大品牌
Solve typescript error: a computed property name in an interface must refer to an expression why type
node生成token与验证token(typeScript语法)
arguments
C语言结构体初始化的四种方法
H5在移动端上禁止缩放
小程序CMS动态处理数据之内容模型和内容集合的使用
力扣解法汇总1175-质数排列
2、 Notes
力扣解法汇总324-摆动排序 II
Applet implementation list and details page
Verilog for loop (1)
"Review of software engineering in Wuhan University of technology" Chapter 2 | software process model
Jinan Zhangqiu subject three data collection
女嘉宾报名
debug glance(by quqi99)
juju debug hacks (by quqi99)
A trick to teach you how to visualize recruitment data ~ is there anyone who can't analyze these data cases?
按结构体某一元素排序的小程序(fishing_3)