Eric Miller
asked on
Cron job never runs on vCenter 6.5 appliance
I have a script that will backup vcenter 6.5 via https://vm.knutsson.it/2017/01/vmware-vcsa-6-5-scheduled-backup/. The script runs just fine when I manually run it. But my cron job never runs, and I can't even find any logs to troubleshoot it. I log in with root via SSH and run crontab -e. I then add the following line: 0 2 * * * /usr/local/bin/vcsabackup. sh. Nothing ever happens.
ASKER
Thanks for reaching out. I tried adding the root user to it, but it still didn't work. That log isn't the correct location because it's not RHEL. It's the Linux version that comes on VMware vCenter 6.5 appliance. Crond service is running though.
Sadly Im not familair with vCenter. Does vCenter offer manpages you can consult?
usually command: 'man 5 crontab' (5 is the Cronie Users Manual on most distro's)
usually command: 'man 5 crontab' (5 is the Cronie Users Manual on most distro's)
ASKER
I found the log location which led me down the right path. On the vcenter appliance it is at /var/log/messages. The error in the log led me to this article which was the problem. https://www.drewgreen.net/wordpress/2017/04/19/fix-for-cron-failing-on-vmware-vcenter-server-appliance-vcsa-6-5/
There is no password-auth file. The crond file needs to have system-auth instead of password-auth.
There is no password-auth file. The crond file needs to have system-auth instead of password-auth.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the tip.
Review this for further details ;-)
http://www.linux-pam.org/Linux-PAM-html/sag-configuration-file.html
http://www.linux-pam.org/Linux-PAM-html/sag-configuration-file.html
Open in new window
Like
Open in new window
The logging is (RHEL):
cat /var/log/cron
Also make sure the crond is running (RHEL).
/etc/init.d/crond status