LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Closed Thread
  Search this Thread
Old 07-30-2012, 07:18 AM   #1
suboss87
Member
 
Registered: Dec 2010
Posts: 31

Rep: Reputation: 0
Red face Need help for shell script automation


Hi All,
Need help for writing an automation script. Yet I had written a script but its not working,

Code:
#!/bin/bash

#copying files from local machine to remote server by scp
scp -r /useradd.sh user@172.29.16.19:/home/user

# Second step making ssh login for executing the script on remote server
 ssh@172.29.16.19

# switching user account
su - root (script should run as root)
echo "password"

./home/user/useradd.sh (executing the script)

finally i have to capture a log of the script process.
This is my script for automation, Were i have run the "useradd.sh" script on the remote servers from my local machine.Kindly help me to write a clear script.
Thanks in advance.

Last edited by suboss87; 07-30-2012 at 07:21 AM.
 
Old 07-30-2012, 07:58 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
Old 07-30-2012, 07:59 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Please post your thread once and in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread should be closed because it is a duplicate of http://www.linuxquestions.org/questi...on-4175419340/.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP Automation script harsh_datir Linux - Networking 1 12-01-2010 01:25 AM
Automation script vijayan361 Linux - Newbie 7 01-23-2009 06:42 AM
LUKS automation script jippo Linux - Security 6 01-12-2008 12:56 AM
Telnet automation script senthilvael Linux - Newbie 15 11-19-2007 04:38 PM
User automation Script Pigdog Linux - Networking 1 02-26-2003 02:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration