• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3189
  • Last Modified:

restart service periodically.

I would like to restart a service automatically every 30 minutes every hour every day on my windows 2003 server.
how would I do that? Please help.

thanks
0
eggster34
Asked:
eggster34
1 Solution
 
LanMan_cwCommented:
Make a batch file to net stop service name then net start service name. You may have to put the service name in quotes. Use scheduled tasks to schedule the batch file to run daily. Once the scheduled task is created, open the task acd click on the schedule tab. Choose the advanced tab so that you can get more granular with the frequency of the scheduled task. Check repeat task and set for every 30 minutes and the duration for 24 hours every day. The task schedule should now say Every 30 minutes starting at x time for 24 hours stating x day.
0
 
jkrCommented:
If the service start type is set to "automatic", the Service Control Manager will restart it anyway.
0
 
ECNSSMTCommented:
The above  processes are valid, but the question is why do you want to do this in the first place?  If the service hangs every 30 minutes; there is a bigger issue there and you may want to investigate the cause further.  

If there is a problem, you may not want to mask the issue by attempting to fix a symptom.  

As well, DEPENDING on the Service you are attempting to do this to; the Automatic setting may just be good for one or two restarts before it stops working.  And the scheduled batch may get "stuck" attempting to start the service.  These things sometimes happens.   If you implement the above processes, you just may want to baby sit the Service for a day, just to prove me wrong....

Regards,
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
eggster34Author Commented:
my service is a merak service.
is there a tool that would do this automatically rather than doing it through scripts?
I have to force the stopping starting of the service since it doesn't work otherwise (it just hangs and says "stopping" and does nothing else.)
0
 
LanMan_cwCommented:
i am not sure of any software that can do this but the script is very short and will cost you nothing but the time to set it up.
0
 
g127404Commented:
Any tools available like scripts and even third party tools will attempt to stop and then restart the service.  If the service stops and hangs it will require manual intervention.  you'll need to work with the vendor/programmer that created the service to figure out why it bombs on you.
0
 
ECNSSMTCommented:
to start and stop a mail service is very unusual.  You may want to see if Merak has any kind of an update that will permit it to work with a Win2K3 server.  Especially since you say it hangs during the stopping..

Regards,
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now