0
点赞
收藏
分享

微信扫一扫

赠品:跳动的心

mm_tang 20小时前 阅读 1

Linux crontab练习之在系统中设定定时任务并优化定时任务_2

要求

  • 每天凌晨4点系统的设备使用信息并以邮件的方式放送到root邮箱中
  • 确保此任务为系统定时任务

脚本实现

#!/bin/bash

dnf install postfix s-nail-14.9.22-6.el9.x86_64 -y &> /dev/null

systemctl enable --now postfix

echo "* 4 * * *  root df -h | mail -s test root"  >> /etc/cron.d/testfile

chmod +x test2.sh
举报

相关推荐

0 条评论