Need help for writing an automation script. Yet I had written a script but its not working,
#copying files from local machine to remote server by scp
scp -r /useradd.sh firstname.lastname@example.org:/home/user
# Second step making ssh login for executing the script on remote server
# switching user account
su - root (script should run as root)
./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.