Saturday, November 19, 2011

Solaris: Using rsync to tranfer dir between two hosts


Transfer data from host3 to host4 via rsync and nfs
hostp3% more copyemea.sh
#! /bin/sh
date> copy.log
/opt/csw/bin/rsync -ar --stats /app/iwstoreEMEA_snap/ /hosta4_EMEA/ 2>&1 >>copy.log
date>> copy.log
hostp3% df -h /hosta4_EMEA
Filesystem             size   used  avail capacity  Mounted on
hosta4:/opt/app/data/iw-store/EMEA
                       250G   134G   116G    54%    /hosta4_EMEA
hostp3%
in this case
hosta4#zfs set sharenfs=rw=153.88.177.59,root=153.88.177.59 app/iwstoreEMEA
where 
153.88.177.59 is ip address of host3
on host3
host3# mount host4:/opt/app/data/iw-store/EMEA /host4_EMEA
Initial data on host4 must be empty, if not unexpected result might happens. Such as size final transfer > host3 dir

No comments:

UNIX: How to print column nicely using printf

[user@hostfwnms1-oam tmp]# cat b.sh printf "%-26s %-19s %-8s %-8s %-s %-s\n" HOSTNAME IP PING SNMPWALK 0-ok 1-fail for i in `cat n...