1

We run VMWare vSphere 4.1, and VMWare Data Recovery 1.2. We have a weekly window with no backups happening, and due to some instabilities, we would like to try scheduling an automatic weekly reboot of the VMWare Data Recovery appliance.

More specific details: - VMWare Data Recovery 1.2 seems to be based on CentOS 5.2. - We use NFS for data storage. The appliance sees this as local storage, but the drive is actually stored in a different building. Seems to work great, and so far has been significantly faster and more stable than CIFS (which we used before).

I have tried scheduling the reboot using /etc/cron.d within the VDR appliance itself:

/etc/cron.d/sunday_reboot:

45 1     * * sun   /usr/local/bin/custom_reboot.sh >> /var/log/reboot.log

/usr/local/bin/custom_reboot.sh:

#!/bin/bash
/bin/echo "==================================="
/bin/date
/bin/echo "Rebooting server now."
/usr/bin/reboot

I also restarted crond, /etc/init.d/crond restart However, /var/log/reboot.log stays empty, and uptime shows that no reboot ever happened.

What am I missing?

3
  • Have you considered upgrading to VDR 2.0? Apr 23, 2012 at 10:11
  • I thought the exact same thing, there's been no reason to stick with 2.0 for the best part of a year.
    – Chopper3
    Apr 23, 2012 at 21:36
  • As far as I know, VDR 2.0 requires vSphere 5, and we don't have an upgrade license for that. So for the time being, vSphere 4.1 and VDR 1.2 it is for us.
    – UrkoM
    Apr 24, 2012 at 7:21

2 Answers 2

1

Any reason you can't schedule the reboot outside of the OS, as detailed here? Reboot Virtual Machine every 20 minutes

1
  • For some reason, I couldn't find any clear description of "shut down", and I was worried that it would be a hard shut down. From your link, it looks like "Shut down" is tidy. In that case, yes, this would be the best option.
    – UrkoM
    Apr 24, 2012 at 7:44
0

The format of the file you created under /etc/cron.d is invalid. You missed the username field. So, try the following:

45 1     * * sun  root /usr/local/bin/custom_reboot.sh >> /var/log/reboot.log

Also, you need to check the permissions of the script you created and make sure it has execution permission x. This is to answer your question regarding the cron job.

Continuously rebooting a server is not a good idea. It would be really better to find the issue instead of just rebooting even when you are doing it weekly.

2
  • I will give your suggestion a try. I think at some point I had "root" in there, but made no difference. I agree that rebooting a server regularly is not a good idea, but the VMWare Data Recovery is a commercial application, and it doesn't give a lot of information on what goes wrong. It just stops doing the scheduled backups, and I can't find anything that is misconfigured. It is a virtual machine itself, with a single purpose, so as long as this makes the backups happen reliably, that's all that matters.
    – UrkoM
    Apr 23, 2012 at 7:47
  • Even when adding "root" there, it didn't work. It seems there is something in the crond that VMWare has running in VDR that doesn't look at "/etc/cron.d/". I got it to work by using "crontab -e", and creating the task for the root user, and not at the whole system level. But I'm going to change it to the solution suggested above. Somehow I didn't find it in my search.
    – UrkoM
    Apr 24, 2012 at 7:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .