VMware vSphere

 View Only
  • 1.  crontab problem with .#root

    Posted Jul 25, 2012 02:37 PM

    Hi all!

    I try to schedule the stutdown and start of a virtual machine on esxi5.

    My problem is that if i macke any changes on  /var/spool/cron/crontabs/root file the esxi creates a new file called .#root and is using this file.

    Also if i try over /etc/rc.local and restart the server there is the same problem.

    rc.local creates the root file with the right settings, but also creates the .#root file without my modified settings and works with this.

    Someone any idea?

    I worked now for a hole day an cannot find a solution.

    Has vmware did any changes here?

    Thanks!

    Harald



  • 2.  RE: crontab problem with .#root

    Posted Jul 25, 2012 03:56 PM

    Follow the steps under the section "Configure on ESXi" in Cronjob FAQ @  http://communities.vmware.com/docs/DOC-8760.

    The guide is for configuring getto, you can ignore the steps related to getto, just follow the cronjob related steps.



  • 3.  RE: crontab problem with .#root

    Posted Jul 26, 2012 08:09 AM

    I followed exactly this steps, but it doesn't work for me.

    mv /var/spool/cron/crontabs/root.backup /var/spool/cron/crontabs/root

    After this step i have 2 files, root and .#root

    And cron is working with .#root



  • 4.  RE: crontab problem with .#root

    Posted Jul 26, 2012 10:02 AM

    Try this http://www.jules.fm/Logbook/files/add_cron_job_vmware.html

    1. Kill crond first.

    kill $(cat /var/run/crond.pid)

    2. Edit the file.

    3. start crond.

    busybox crond.

    /bin/kill $(cat /var/run/crond.pid)
    /bin/echo '5 0 * * * /full/path/to/script arguments/with/full/path > /full/path/to/logfile 2>&1' >> /var/spool/cron/crontabs/root
    /bin/busybox crond



  • 5.  RE: crontab problem with .#root

    Posted Aug 02, 2012 08:41 AM

    I did it exactly this way. But still the same shit.......

    After i edit i have this .#root



  • 6.  RE: crontab problem with .#root

    Posted Apr 11, 2022 09:28 AM

    i know this is old, but some will probably find this thread...

    the solution is to force write by this command:

    VI Editor

    Note: When using :wq to save your changes, you’ll likely get a warning that the file is read only. You don’t need to fiddle with the permissions. Simply use :wq! and the file will be written successfully.  



  • 7.  RE: crontab problem with .#root

    Posted Jul 25, 2012 03:57 PM

    The VM power operations can be automated easily using vCenter Server. I'm sure you should aware of it, just quoting here if you are not.



  • 8.  RE: crontab problem with .#root

    Posted Jul 26, 2012 08:10 AM

    Yes i know.

    But i have no vCenter Server....  :-(