Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Batch file in server 2008 environment


  • Please log in to reply
10 replies to this topic

#1 KJackson50

KJackson50

  • Members
  • 95 posts
  • OFFLINE
  •  
  • Local time:10:00 AM

Posted 07 June 2013 - 11:15 AM

I really like this forum, you guys have been very helpful thus far.

 

I have a question about using a batch file to restart 3 servers on a weekly schedule. My plan is to create a simple batch file that restarts 3 of the servers at my job every saturday morning. My friends say it's a bad idea. Any insight?

 

Thanks a bunch guys



BC AdBot (Login to Remove)

 


#2 chrisd87

chrisd87

  • Members
  • 811 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NC
  • Local time:10:00 AM

Posted 07 June 2013 - 06:51 PM

I would simply create a scheduled task on the server to restart it for you. It will save you a lot of headache with the programming and etc.


"Like car accidents, most hardware problems are due to driver ɹoɹɹǝ."

 


#3 heinkeljb

heinkeljb

  • Members
  • 5 posts
  • OFFLINE
  •  
  • Local time:03:00 PM

Posted 12 June 2013 - 10:42 AM

Batch file is only a set of commands in a list - you still have to remember to run it! Use the advise above then the servers will use the calender to know which day it is and do the task for you.

 

John



#4 KJackson50

KJackson50
  • Topic Starter

  • Members
  • 95 posts
  • OFFLINE
  •  
  • Local time:10:00 AM

Posted 12 June 2013 - 12:41 PM

Thanks for the replies.

 

I guess my real question was. If I restarted the servers on a schedule, will that cause any corruption or hang ups?  Also this is for work, if it was for a home server I wouldn't care about the risk, but there is a lot more at stake lol!

 

They said something like scheduled restarts could cause crazy things to happen (if a process or program is running), and it's best not to take the human element out of it.



#5 chrisd87

chrisd87

  • Members
  • 811 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NC
  • Local time:10:00 AM

Posted 12 June 2013 - 04:41 PM

I don't know why you would want to have the server to restart because they are meant to be ran 24/7. When you restart the servers, I know that it prompts you to why you want to restart/shutdown for, and you have to specify a reason as to why the server is being restarted/shutdown. That might cause a headache when trying to restart them using a batch or scheduled task as when the task runs it may just hang on the restart screen asking why you are restarting/shutting down.

 

IMO I would never restart unless there is a reason to restart such as maybe updates or something.


"Like car accidents, most hardware problems are due to driver ɹoɹɹǝ."

 


#6 KJackson50

KJackson50
  • Topic Starter

  • Members
  • 95 posts
  • OFFLINE
  •  
  • Local time:10:00 AM

Posted 12 June 2013 - 05:03 PM

Updates and such, that's exactly why I even considered an automatic restart solution. Also there is a way to code it to answer the "restart/shutdown" reason. I've tested that out.

 

So as far as the "hangs", would there be other down falls to using a restart batch file on a schedule (on a server)?



#7 KJackson50

KJackson50
  • Topic Starter

  • Members
  • 95 posts
  • OFFLINE
  •  
  • Local time:10:00 AM

Posted 14 June 2013 - 10:00 AM

Thanks for the insight guys, we came up with a solution!



#8 chrisd87

chrisd87

  • Members
  • 811 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NC
  • Local time:10:00 AM

Posted 14 June 2013 - 03:11 PM

Can you share with us what you finally decided?


"Like car accidents, most hardware problems are due to driver ɹoɹɹǝ."

 


#9 KJackson50

KJackson50
  • Topic Starter

  • Members
  • 95 posts
  • OFFLINE
  •  
  • Local time:10:00 AM

Posted 14 June 2013 - 03:17 PM

Until I fully test it out somehow I will leave it alone for now. I'd need to have a test machine and have it on a restart schedule for a week to see if anything is amiss. I do appreciate everyones comments and suggestions however.

 

Thanks a bunch!



#10 Sneakycyber

Sneakycyber

    Network Engineer


  • BC Advisor
  • 6,092 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ohio
  • Local time:11:00 AM

Posted 16 June 2013 - 06:25 AM

Following Best Practices for Server 2008 (and advice from Serverfault) you never want to have a server automatically install updates. When updates are installed and the server is "waiting" for reboot its in a "Intermediate" state. This can cause problems with applications and further updates. You should set Automatic updates to Notify not install. Then perform regular maintenance on the the server weekly. I am quite sure there is a VBS script to reboot the server or put the server in Maintenance mode automatically for Windows updates. However if there is an issue with a Released update or other problems with the server and you havent logged in for a month it could get allot worse.

 

 

Reference:Chris Thorpe Serverfault.com


Edited by Sneakycyber, 16 June 2013 - 06:26 AM.

Chad Mockensturm 

Systems and Network Engineer

Certified CompTia Network +, A +


#11 chrisd87

chrisd87

  • Members
  • 811 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NC
  • Local time:10:00 AM

Posted 16 June 2013 - 05:20 PM

Another alternative to do is use the Windows Update Agent to manually control all of your updates. You don't want the update installed, you don't have to install it. You only want the update on 1 machine and not the others, then that can be done as well. It's a really powerful tool to use, and helps managing updates a breeze.

 

There is a separate product called Windows Server Update Services (WSUS) to allow for an internal update management. Updates for all Microsoft products can be downloaded to a WSUS server and automatically as well as manually approved for the use in the enterprise.

 

 


Edited by chrisd87, 16 June 2013 - 05:20 PM.

"Like car accidents, most hardware problems are due to driver ɹoɹɹǝ."

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users