【发布时间】:2018-04-27 05:42:54
【问题描述】:
我创建了一个 test.sh shell 脚本,我使用 crontab -e 安排了它每 1 分钟执行一次并将输出重定向到一个文件。
test.sh
echo "Printing all Environment Var"
env
echo "Bye Bye"
下面是我的 crontab 的样子
#crontab
0,1,2,3,4,5,6,7,8,9,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59 * * * * sudo su - admiir -c /u01/users/admiir/test.sh > /u01/app/iir/InformaticaIR/iirlog/crontab_launchsh.log
当我运行 ls -ltr 时,时间戳正在更新,但输出文件中没有打印任何内容。
【问题讨论】: