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?
Any reason you can't schedule the reboot outside of the OS, as detailed here? Reboot Virtual Machine every 20 minutes
The format of the file you created under
/etc/cron.d
is invalid. You missed the username field. So, try the following: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.