4 Replies Latest reply on Mar 17, 2016 5:43 AM by markpiontek

    esxi 6 cron issue | multiple root crontabs exist

    markpiontek Novice

      It seems that I have two cron files:

       

      [root@vmhost:~] ls -al /var/spool/cron/crontabs/

      total 16

      drwxr-xr-x    1 root     root           512 Mar  8 15:53 .

      -r--r--r-T    1 root     root           256 Sep 16 10:51 .#root

      drwxr-xr-x    1 root     root           512 Mar  7 14:58 ..

      -r--r--r-T    1 root     root           600 Mar  8 15:53 root

       

      I can edit "root" but I cannot edit ".#root" and my cron job is not firing.  Copy and paste the command and it runs as expected.

       

      Any operation against /var/spool/cron/crontabs/.#root results in "Operation not permitted"

       

      I've seen posts where others were successful in getting cron working in esxi 6.  I am using Dell Embedded esxi - could that be the issue?

        • 1. Re: esxi 6 cron issue | multiple root crontabs exist
          MKguy Virtuoso

          I am using Dell Embedded esxi - could that be the issue?

          No, the hardware vendor custom images are 100% VMware ESXi binaries plus some added/updated hardware device drivers and hardware management agents

           

          ESXi runs from a RAM-disk, the files prefixed with a ".#" are the original files from the bootbank state.tgz.

          Try to manually invoke the the config backup scripts with:

          # /sbin/auto-backup.sh

          # backup.sh 0

           

          Have you also tried restarting the cron service after making your change?

          1 person found this helpful
          • 2. Re: esxi 6 cron issue | multiple root crontabs exist
            markpiontek Novice

            That is what I thought regarding the Dell Embedded image, but the cron job is not firing.  I have verified it does run manually.

            I have previously run /sbin/auto-backup.sh and also restarted the cron service and the esxi server.  I had not run backup.sh 0.

            • 3. Re: esxi 6 cron issue | multiple root crontabs exist
              MKguy Virtuoso

              Does your script have the executable file permission set and "#!/bin/sh" shebang?

               

              Are you sure you restarted the crond like this?

              # kill -HUP $(cat /var/run/crond.pid)

              # /usr/lib/vmware/busybox/bin/busybox crond


              I just tested it myself on ESXi 5.5 and after restarting crond like this, my manually added cron job actually worked. You can also see logs of cron jobs with

              # grep cron /var/log/syslog.log

              • 4. Re: esxi 6 cron issue | multiple root crontabs exist
                markpiontek Novice

                Oh man, I am an idiot.  I figured it out.  In all this time I spent troubleshooting I didn't catch that my local.sh echo statement was missing the most essential piece for a cron job to work: "0 0 * * 1,2,3,4"

                So, upon rebooting the esxi server, my cron file went from "0 0 * * 1,2,3,4 /opt/ghettovcb/bin/ghettoVCB.sh.... " to "/opt/ghettovcb/bin/ghettoVCB.sh..."  It's such a long line, I kept overlooking it!


                I am not new to this.  I have been using ghettoVCB on esx 4 through esxi 5.5.  For some reason I got stupid when moving to esxi 6.


                Thanks for the help!