shell脚本在crontab 定时任务中 没有输出结果

  在非root用户下 写了一个shell脚本   通过手动执行shell脚本  sh -x script.sh  可以正常输出 当把该脚本加入到crontab中后  定时任务有调用.但不会输入结果

    

                      需要在脚本中增加。

#!/bin/bash
. /etc/profile
. ~/.bash_profile

在SUSE 中 使用已下行

if [ -f ~/.profile ];
then
  . ~/.profile
fi

posted @ 2017-03-03 15:56  XavierLee  阅读(1307)  评论(0编辑  收藏  举报