Friday, 14 May 2021

UNIX: Copy file to multiple hosts without password

In bash shell script:


for HOST in company-xxx-prm-db company-xxx-stb-db company-klf-prm-db company-klf-stb-db company-seha-prm-db company-seha-stb-db; do

    sshpass -p "oracle" scp maillist.txt $HOST:/home/oracle/scripts/

done

No comments:

Post a Comment

Number of Visitors