LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Need help for shell script automation (https://www.linuxquestions.org/questions/linux-server-73/need-help-for-shell-script-automation-4175419339/)

suboss87 07-30-2012 07:18 AM

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.

acid_kewpie 07-30-2012 07:58 AM

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.

unSpawn 07-30-2012 07:59 AM

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/.


All times are GMT -5. The time now is 11:37 AM.