Link to home
Start Free TrialLog in
Avatar of Doodad Boy
Doodad BoyFlag for Malaysia

asked on

reboot server with scheduled time and week base

Hi Team,

I have a situation here whereby if one of specific services not not started, the server need to be rebooted with a condition, it only allowed to reboot on specific time, which is the server only can be rebooted every 2nd wednesday 5-6 am.

how to schedule this in command prompt so that can be save as a batch file
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Create a batch file called "rebootserver.cmd"
Include ONE line as follows:
shutdown -r -t 1

Open in new window


Then use the Task scheduler and schedule that batch file when you need it run.  It's very simple.  I do this in some places where necessary.
You do not even need the batch file - just type the command line above into the action part of a scheduled task.
ASKER CERTIFIED SOLUTION
Avatar of Frank Helk
Frank Helk
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you can wait up to 14 days to reboot a server when a service dies it can't be that critical a service... Maybe some service monitoring and alerting is better for you... At least you would get a warning and you can try and restart the service manually.