Crond not working

General support questions
Post Reply
paolochieco
Posts: 3
Joined: 2019/02/21 16:08:49

Crond not working

Post by paolochieco » 2019/02/21 16:13:48

Good evening.
I'm tryng to set a cron job that launch a script.
For some reason, on Centos 7 in VMWare Workstation VM, it work just fine.
In CentOS 7 in ESXi VM it doesn't work at all.
I've tried to install the same ISO, with the same configuration of hardware, givin a cron job that launch the same test script.
On Vmware it work, on ESXi not.
Thanks in advance
BS

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Crond not working

Post by TrevorH » 2019/02/21 17:10:58

It won't have anything to do with vmware vs esxi, that's almost certainly just a coincidence.

Look in /var/log/cron and see if your task is being run at all. If it is tehn check it for errors. If you redirect stdout/stderr to /dev/null then the errors will never be seen - redirect them to a file instead until you get it working. Cron tasks run with a very restricted set of environment variables including PATH= so if your script resides outside those or anything it invokes does, then it will fail. It's good practice to always include the full path to any executable you intend to run from within cron.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

paolochieco
Posts: 3
Joined: 2019/02/21 16:08:49

Re: Crond not working

Post by paolochieco » 2019/02/21 17:51:57

TrevorH wrote:
2019/02/21 17:10:58
It won't have anything to do with vmware vs esxi, that's almost certainly just a coincidence.
I'm sure about this. But the fact is that on many CentOS machine on ESXi i notice crontab doens't work, i maybe miss some configuration to get him work properly? Because even on a machine with Ubuntu Server work and on a new that I have installed right now not. On every machine on Workstation pro works.

Evrery cron job is added with full path to the script.

By the way now i have to reinstall CentOS to give you the log.

I can't undestand why this is happening. Same configuration in crontab.

paolochieco
Posts: 3
Joined: 2019/02/21 16:08:49

Re: Crond not working

Post by paolochieco » 2019/02/21 18:14:16

I found the issue. And it was related to ESXi as i was thinking.
Please don't joke me.
For some reason in Vmware Workstation set automatically the time-zone correctly. On ESXi i have to do manually. I notice that reading the log.
Thanks for your time.
Best Regards

Post Reply