36 11 * * * source /etc/profile;/bin/bash -x /tmp/zimbra_delivery_report.sh > /tmp/666 2&>1
这种是不可以的,即使加了source /etc/profile; 也是crontab中执行不成功
原因是:
> /tmp/666 2&>1
解决方法:
2>&1
另外需要在zimbra的crontab中添加
source /opt/zimbra/.bashrc
否则报错如下:
Can't locate Net/LDAP.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/zimbra/bin/zmaccts line 43.
BEGIN failed--compilation aborted at /opt/zimbra/bin/zmaccts line 43.
本文转自Tenderrain 51CTO博客,原文链接:http://blog.51cto.com/tenderrain/1914476,如需转载请自行联系原作者