查看cron運行日志
tail -f /var/log/cron
報如下錯誤:
May 8 10:14:01 localhost crond[9399]: (root) FAILED to authorize user with PAM (Module is unknown) May 8 10:14:01 localhost crond[9400]: (root) FAILED to authorize user with PAM (Module is unknown)
網上有如下解決方法:
- 修改/etc/pam.d/crond,把把所有required改成sufficient,這個可能對非root用戶管用。
# # The PAM configuration file for the cron daemon # # # No PAM authentication called, auth modules not needed account required pam_access.so account include password-auth session required pam_loginuid.so session include password-auth auth include password-auth
最終解決辦法:
重啟crond服務
/etc/init.d/crond restart