Hi all,
I am trying to write a script that syncs files from source to destination. I have one centralized server that can ssh to any servers without pw. Now when I run the script, it can ssh to source server perfectly fine, but you need to enter password for destination server. Was wondering how I can clean this up before I start using case statements
Below is a sample I wrote
#!/bin/bash
#This scripts syncs shit
echo "Type in ID: "
read ID
echo "Type in Server : " #source server
read S
echo "Type in Destination Server: "
read DS
if [ $S == 9 ]; then
ssh -t "root@"$S"webserver1" "rsync -av /home/rlui/"$ID "root@"$DS"webserver2:/home/rlui/";
ssh -t "root@"$S"webserver1" "rsync -av /home/rlui/tmp/"$ID "root@sl"$DS"webserver2:/home/rlui/tmp/"
exit 1
where S and DS are cluster numbers
I apologize in advance if I am not clear on anything