need a help for writing automation script
Hi All,
Need help for writing an automation script. Yet I had written a script but its not working, Quote: #!/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. |
Since you insist on violating the LQ Rules I'm giving you a 1 day timeout. Bye.
|
1) Please post your code under [code/] [/code] tag.
2) Sorry, I am not clear on what you are looking for, please mention your motive clearly.. But from what i understand, please check "expect" on google. I hope it helps. |
In cases where something doesn't work according to your expectations, it is necessary to tell us what your expectations are. Otherwise, we read the code, observe what it says, and either see that it can't do anything, or see what it does do. If it does something, we can only guess what your intentions were, and there is a vast universe of possibilities for what that might be. Without enough information, I might interpret your intentions incorrectly, and suggest that you need to do something like adding
Code:
// rm command removed --- rod |
Not suggesting it, but you felt the need to put it anyway. Modern rm implementations will recommend against it, but I don't think that's a good suggestion as your sarcasm may not be interpreted as such.
|
Sarcasm?
|
All times are GMT -5. The time now is 08:40 PM. |