Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crontab for auto shutdown

Status
Not open for further replies.

RamaBaru

IS-IT--Management
Aug 7, 2007
4
US
Hi,

I am completely new to shell scripting. I have to bring down some my linux servers every Friday night and bring them up Monday. I would like to automate this process, at least the first part. i.e. I would like to write a crontab that reads the DNS resolable hostnames from a file and shuts them down at 7pm on every Friday. For any reason if the script couldn't do so( example: couldn't ping), it should be logged into some error log. Can you please help me?

 
My only question would be why? The more you shutdown and restart, the more strain you're putting on your boxes.

I want to be good, is that not enough?
 
My problem is creating the config-file from which crontab needs to read.

I can create crontab scehuler.

The reason for shutting down is - we observed thermal breakdown because there is a regular shutdown of air conditioner in the building on Sundays.

I will check BIOS to verify if it could be woken-up thru LAN. If the above works it solves at least half of my problem.
 
How long does the shutdown of the air conditioning last? I think I'd be looking at power/environment monitoring variables (maybe eeprom?) to prevent the machine shutting down during this period (asumimg it's not long enough to afford any threat to the machine).

I want to be good, is that not enough?
 
I'm not sure I understand why you wouldn't be solving the root cause?! Spent money on keeping the environmental services running instead of scripting server shutdown/startup.

Obviously I have no understanding of your financial or environmental condition, but it really seems like servers in a data center would not be subject to this problem. And servers that are NOT in a data center environment are subject to all sorts of issues: environmental risks, power risks, spills, local console mischief, cable damage...

Sorry, I should sit quietly instead.

D.E.R. Management - IT Project Management Consulting
 
Hi,

I would be interested in the technical solution. Thanks for other suggestions though.

Rama
 
You may want to investigate/invest in remote/smart power switching solutions.

If your servers do not have the right wake-on-LAN capabilities, many data centers have remotely controllable power outlets/strips that would potentially match up with your needs...

Thus, crontab to shutdown by 23:00 hours... Process control to shutoff power by 24:00 hours. Process control to restore power by 07:00 hours.

This would also enable remote hard reboot.

D.E.R. Management - IT Project Management Consulting
 
Thedaver, KenCunningham,

Please !!! ... If you are not sure on how to help with my script, that's alright.

Stefanwagner,
You have touched the subject with your questions, any solutions please?
 
Rama;
This isn't some free consulting forum where you can toss out a request and people are going to jump in and solve the thing down to the last detail.

How about you read up on the ideas in Stefan's post and try to write something yourself?

Your question will be a lot better received if you post some code rather than ask us to write it. Otherwise you're getting into a consulting request which, in my opinion, involves fees.

D.E.R. Management - IT Project Management Consulting
 
Rama:
The tone of your message sounds very condescending. I've been on this board (as with the others) for many years and I can tell you that we here are more than willing to help if:
1) You clearly state the nature of your task.
2) Constraints on achieving your goal.
3) Show us what you have done.
4) Detailed description of what doesn't work
5) Error output.

Like thedaver said, we are not a consultancy forum. Help here is given at our own time & cost. We help people who can help themselves first.

--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top