Link to home
Start Free TrialLog in
Avatar of jasgot
jasgot

asked on

Need to sync two remote file systems from a unix box.

I have two snap servers, each has about 6 gb of data in a directory that I would like to replicate to the other.  The two snaps and the unix (sco) are on the same wan.  No problem to connect, all three see each other.  I need to use the unix box because I want the replication to take place each night and it is the only operating system that stays running through the night.

Rsync won't work because it requires a client and server. I only have one OS to make all the descisions and move the new/changed files.

Any idea what I can use? I have scoured the net for days and cannot find something so simple....

I'm giving max points because I need a valid working answer, not just a direction to looking.

Thanks.

ASKER CERTIFIED SOLUTION
Avatar of yuzh
yuzh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Do not fear if rsync takes long for first time - if 90% of your data stays over the day, rsync will not transfer that.
You can start rsync server from command line or via sudo without background daemon running.
ssh and rsync are to be found at caldera.com/skunkware
Avatar of yuzh
yuzh

For the first time, it is better to use ssh + tar to do the job, and  then start from the 2nd use
ssh + rsync it will run a lot faster !
Avatar of jasgot

ASKER

The data has already been manually replicated, so there should be very few files to handle.

So you are telling me I can run

rsync //snap1/dirx //snap2/dirx
rsync //snap2/diry //snap1/diry

without the rsyncd running anywhere and the source AND destination do not have to be a xNIX box?  This goes against everything I have read for weeks......
rsync --rsh="/usr/bin/ssh -l luser /usr/bin/sudo /usr/local/bin/rsync --daemon --server ." -vz root@remotehost::module_from_remote_config/relative_path /somewhere/here
"The data has already been manually replicated, so there should be very few files to handle."

That's a good news! rsync will take a very short time to mirror the two dirs.
I use rsync to mirror more than 120 GB date every night, and I 'm happy with
the result.

If you two boxes are in the same network to can use NFS mount to mount the
remote box to the one which the backup script will be run and make sure it has
root write permission to the remote filesystem , and than use, the
follow systax (use the real path to rsync instead of /usr/local/bin)

 /usr/local/bin/rsync --delete -az ${DIRECTORY} ${BACKDIR}

If you can not use NFS mount, you need to use ssh + rsync:

/usr/local/bin/rsync -e ssh --delete -az root@remote:/home/yuzh/test1 /home/yuzh/test1
http://oldlook.experts-exchange.com/questions/20505177/how-to-sync-two-directories.html

man rsync

to learn more
Avatar of jasgot

ASKER

The two drives that are not running an OS are on different subnets of our network, all within a VPN.

I can get to any device on the other network by IP, I have not tried to do it by \\UNC.  I think I can NFS mount to \\IPADDRESS\share.

Next,

I am in a secure VPN, can I skip the ssh?  I am not even sure if the snap drive allows ssh.



IF you can use NFS mount, then you don't need to use ssh, the syntax would looks like: (eg, mirror /export/data):

cd /export
/usr/local/bin/rsync --delete -az data /IP/share

In case you need to use ssh, you need to install ssh in both boxes. please read throught the example we have posted.



Avatar of jasgot

ASKER

SSH is not an option on a SNAP server. www.snapappliance.com So I hope I can NFS through the gateway on our WAN VPN.

Your example above makes me think you beleive the export data is on the same box as the rsync utility.  Please be mindful of my first post indicating that the syncronization has to be managed from the ONLY xNIX box and the two file systems that need to be replicated are snap servers without any type of OS that I can manage.
Avatar of jasgot

ASKER

OK. I'm going to test the rsync right now. I'll be right back.
"Your example above makes me think you beleive the export data is on the same box as the rsync utility.  Please be mindful of my first post indicating that the syncronization has to be managed from the ONLY xNIX box and the two file systems that need to be replicated are snap servers without any type of OS that I can manage. "

When you setup NFS mount to mount the remote on the machine you run rsync (if you want to write to
the mount filesystem, the NFS file system has to be exported with READ and write permission)

rsync treat the two dirs as local dir.
very easy!
Avatar of jasgot

ASKER

As it turns out, RSYNC is not installed on this SCO box, and to get it installed, would require installing many service level patches and the GCC.  Since this box is supported by another party, I have to see if they will make sure it is at current service levels and if I can install the GCC.

Unless I can find a compiled version of RSYNC for SCO OS 5.0.5.

Avatar of jasgot

ASKER

Although I am unable to get rsync installed.  This would have indeed work well for me.
gnu packages need recent libm.so, ie libm, libc and kernel, they may break a lot of apps (but never NFS mounts)
if you have two nfs mounts syncing by any means will transfer all data to both nfs servers, you need rsync right where your data lies, rsync computes checksums of data blocks and transfers them over wires where rsync protocol lies (ssh, rsh etc). so it comes out that you need rsync daemon available where your "master" data lies, if this is not an option, you transfer all.