一、vi notice.sh(这里没有这个文件的话它会直接新建出来) 二、chmod 777 notice.sh 三、./notice.sh 测试脚本是否正确 四、token码自己获取一下,这里用xxxxx代替,下面内容写到shell脚本里,我这里只写了text类型,其他类型原理一样 curl 'https://oapi.dingtalk.com/robot/send?access_token=xxxxxxx' \ -H 'Content-Type: application/json' \ -d ' {"msgtype": "text", "text": { "content": "shell自动发送" } }' 五、执行sh文件,./notice.sh start