How to write a script by using unix commands to down any server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to write a script by using unix commands to down any server
# 1  
Old 09-13-2007
How to write a script by using unix commands to down any server

Hi,

I need to do frequently server down and up. Every time i am using nearly 5 to 6 commands to down and agin i am using the commands to up.
Can anybody help me to write a script to down and up.
which i can use once on unix platform it can down later it can up the server.
# 2  
Old 09-13-2007
Server shutdown and restart

The simplest way is to use and editor (vi ?) to create something like....

#!/bin/ksh
#################
# Server shutdown
#################
#
command1
command2
.
.
commandn



save this and endsure the script file is executable using chmod +x <scriptname>

then execute it by simply running the scriptfile - the same would apply for your shutdown script.

Depending on your situation it *may* not be quite as simple as this but I hope this gets you started
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to write if condition in shell script for application server?

Hi all, I have a code to create folder in application server through shell script and i want to create if conditional based folder folder=$HOME/test/sample/whatever if ; then echo "$folder already exists, not created." else mkdir -p "$folder" > /dev/null 2>&1 ... (7 Replies)
Discussion started by: Boost
7 Replies

2. How to Post in the The UNIX and Linux Forums

Help me, write a bash script to delete parent entry with all their child entry in LDAP UNIX server

Hi All, Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries. example: Parent is : ---------- dn: email=yogesh.kumar@wipro.com, o=wipro, o=in child is: ---------- dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
Discussion started by: Chand
1 Replies

3. Shell Programming and Scripting

How to write a shell script for rsync to remote server?

Hello, Can you help me to write a shell script for rsync a folder from my server to remote server ? i do this in ssh by this command : rsync -avz -e ssh /copy/me/ login@serverip:/where/to i want have a shell script that do this command. and you know that this command ask remote... (0 Replies)
Discussion started by: Desperados
0 Replies

4. Programming

How to write a shell script to connect to another server?

Hello friends I want to write a script in which I will connect to my friends network. I want to use SSH. Even they can use the script to log into my network and copy files. ssh user@hostname command I know the following command will help me to log into Google's servers and see all the... (12 Replies)
Discussion started by: Angelo
12 Replies

5. Shell Programming and Scripting

How can i write a script to execute commands on the webserver from a browser?

I want to create a script with the php exec() or system() function to execute commands from a remote browser on the webserver. I am open to using Perl or whatever. I am using an Apache2 webserver on Ubuntu. I have done quite a bit of research on this on google and read lots of responses about... (0 Replies)
Discussion started by: bash_in_my_head
0 Replies

6. Shell Programming and Scripting

Need to write a script to reformat a file in unix but not familiar with unix

unix script must do the fiollowing open a file containing comma delimited records > each record contains 10 fields > removes the 2nd field and use that same field containing fields 2 to 10 the original record after fprocessing should containing fields 1 and 3 a new erecord must be... (10 Replies)
Discussion started by: dwightja
10 Replies

7. Programming

To write C Script for connecting to a Server

Hi, I am little bit new to this scripting langauge as such, though I know the basics. I want to write a C script which connect to a server which is listening on tcp/ip via port number 6901 with username and password and then i have to call various services to test the server. Can some one help... (7 Replies)
Discussion started by: Nagesh
7 Replies

8. Shell Programming and Scripting

Pls Help-Script to execute Commands and write to excel file

Execute some commands in script and store result in excel sheet Kindly help me........... (1 Reply)
Discussion started by: Computer_baby
1 Replies

9. Shell Programming and Scripting

how can I write script that lets me run shell commands?

Hello I want to make simple extension to vi , you know how you want to run some shell command you do ":! ls -l " , then you go out the vi the command executed and then you hit enter and you back to vi but now I want to be able to go out of vi and run several command outside of vi .. and in... (3 Replies)
Discussion started by: umen
3 Replies

10. UNIX for Advanced & Expert Users

executing applications/commands on a unix server from a windows PC

i have a network drive (samba) mounted on to my PC and also i have SSH client on my machine. however i need to run applications/commands on a unix server from the middle of a different executable(windows compatable one). so i need to connect to the unix server from SSH through the... (1 Reply)
Discussion started by: megastar
1 Replies
Login or Register to Ask a Question