VMware Cloud Community
oliver_g
Enthusiast
Enthusiast
Jump to solution

Completely unable to get a cron job to run anywhere

Hello members,

I have an update to this issue. for some reason the various cron files on

my VCSA have quite running. The "logrotate" file in cron.daily used to run daily. the log rotation

stopped on Aug 20, 2019. No rotation of any logs that are jobs in the various areas where cron jobs are defined.

I did run the logroate script manually and it did rotate the audit.log. For some reason, even though cron shows as

a pid (cron.pid) and shows in ps A | grep cron - nothing is happening - jobs are not running.

I have attempted to run a simple script as a cron job on an Esxi vCenter host.

Version 6.0 - latest.

I have tried crontab -e, placing script in cron.hourly, placing a file referencing the script in /etc/cron.d and running every 5 min.

it seems that crontab -3 references /var/spool/cron/tabs/root.

None of these methods worked. I have also stopped and restarted the cron pid

Is there any way to get a cron job I created to run from a script?

Thanks,

Eholz1

Message was edited by: oliver g

Reply
0 Kudos
1 Solution

Accepted Solutions
TomHowarth
Leadership
Leadership
Jump to solution

have you followed this process?

https://drewgreen.net/fix-for-cron-failing-on-vmware-vcenter-server-appliance-vcsa-6-5/

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410

View solution in original post

Reply
0 Kudos
3 Replies
TomHowarth
Leadership
Leadership
Jump to solution

have you followed this process?

https://drewgreen.net/fix-for-cron-failing-on-vmware-vcenter-server-appliance-vcsa-6-5/

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
Reply
0 Kudos
oliver_g
Enthusiast
Enthusiast
Jump to solution

Not yet - will try now - and get back - thanks for some help on this,

Oiver G

Reply
0 Kudos
oliver_g
Enthusiast
Enthusiast
Jump to solution

Hello Again, and thanks for input,

One more thing to add - I am trying to run this cron job on a vCenter Server Appliance - not a plain old Esxi host.

Could it be that I cannot run a cron job on a VCSA??

But cron job is flat not running, There must be some basic setting or feature that I am missing.

The root crontab file is located in /var/spool/cron/tabs/root - This is for vCenter ver 6.0 U3

This is on a vCenter server appliance - suse linux based.

the script has #/!bin/sh

I can stop and start cron - no longer called crond. so the pid is cron.pid, etc

I get no info in the /var/log/cron file, Here is my cron job file: - set to run every minute just for testing:

* * * * * /root/monitor > /root/cron.log 2>&1

I get no data in the cron.log file either.

There is a file in cron.hourly - netnumber - I do not think that runs either.

Here is a copy of my crond file:

#

# The PAM configuration file for the cron daemon

#

#

auth     sufficient     pam_rootok.so

auth     include        common-auth

account  include        common-account

password include        common-password

session  required       pam_loginuid.so

session include         common-session-su

session  optional       pam_env.so

I have the script in the /root directory on the host. I can run the script from the command line, of course, it works...

Any other suggestions?

Oliver G

Reply
0 Kudos