I am trying to use rsync to synchronise remote files with local server. It works great but I want to do it on multiple remote servers to sync with on daily basis.
sshpass -p "xyz" rsync -avz firstname.lastname@example.org:BrandStIN/ /home/lanein1/BrandStIN/ sshpass -p "xyz" rsync -avz email@example.com:MarySt/ /home/lanein1/MarySt/ sshpass -p "xyz" rsync -avz firstname.lastname@example.org:IWM/ /home/lanein1/IWM/
I have 10 IP numbers which I have to rsync daily for checking , How I can do that by using BASH script. So that I can automate that task by using cron. I want BASH script only.
I am struck here.I have all the Ip addresses in a text file and dont know how to call the file on rsync with their passwords.
#!/bin/bash # Program name: rsyncall.sh date cat /path/to/IP.txt | while read output do........