Could someone perhaps give their advice on this.
I am wanting to take an output file from a mysql query ran:
$code $IP
123456 192.168.26.176
10051 192.168.20.80
234567 192.168.26.178
and run it in command:
rsync -rvp *.$code.extension root@$IP:/path/of/dest
I am trying this:
while read -r line ; do echo
"$SOURCE_TRANSMIT_DIR"*."$code".class.json
"$DEST_HOST"@"$IP":"$DEST_TRANSMIT_DIR" ; done
Output I get is this:
/opt/file/outgoing/*.123456
10051
234567.class.json [email protected]
192.168.20.80
192.168.26.178:/opt/file/incoming/
Where I would like it to read like this in separate rsync commands:
rsync -rvp *.123456.extension [email protected]:/path/of/dest
rsync -rvp *.234567.extension [email protected]:/path/of/dest
rsync -rvp *.345678.extension [email protected]:/path/of/dest
Hopefully this explains better, sorry for the terrible explanation.