linux 看执行任务的一些邮件

本文探讨了在Hadoop环境下,Cron定时任务执行失败的问题,详细分析了shopt/data/smartAuditor.sh脚本执行失败的原因,并给出了通过在脚本中添加source /etc/profile来刷新环境变量的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 cat /var/spool/mail/root 

From root@hadoop01.localdomain  Fri Apr 12 18:44:01 2019
Return-Path: <root@hadoop01.localdomain>
X-Original-To: root
Delivered-To: root@hadoop01.localdomain
Received: by hadoop01.localdomain (Postfix, from userid 0)
    id EBCFD1C081C; Fri, 12 Apr 2019 18:44:01 +0800 (CST)
From: root@hadoop01.localdomain (Cron Daemon)
To: root@hadoop01.localdomain
Subject: Cron <root@hadoop01> sh opt/data/smartAuditor.sh 10 
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <LANG=en_US.UTF-8>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Message-Id: <20190412104401.EBCFD1C081C@hadoop01.localdomain>
Date: Fri, 12 Apr 2019 18:44:01 +0800 (CST)

sh: opt/data/smartAuditor.sh: No such file or directory

指定定时任务  sh手动执行成功 ,contab执行失败  在脚本中添加 source /ect/profile  刷新一下环境变量

转载于:https://www.cnblogs.com/hejunhong/p/10697880.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值