Click to See Complete Forum and Search --> : Can anyone help me with rsync?


arkaine23
12-04-2003, 02:01 PM
I need to rsync config files in /var and /etc on two hosts. I have to use ssh or maybe scp because rsh is disabled. SO I'm pretty sure I'll need to create an rsync user and rsync ssh key, as my regular user so far only gioves errors and root's public ssh key won't work for security purposes.

I'm trying to sync two FreeBSD 5.1 servers so that one of them will be configured to perform the same services as the other if one of them should fail for any reason.

evac-q8r
12-04-2003, 02:08 PM
OK so what exactly do you need help with. I believe that I may be able to help.

EVAC

arkaine23
12-04-2003, 09:12 PM
Well, I'd like to get the files from one host, seagull (remote) and put them on newseagull (local). Seagull serves my company's home directories, so I want to grab them (34GB) from their raid0 SCSI array and stick them on newseagull's 76GB raid1 vinum array. So I'd like to copy /home1, /home2, and /home3 on seagull to newseagull's /home2.

Newseagull will also be grabbing config files from another server (Eagle)... about 4 times daily. Mail, dns maps, that sort of thing.

Ideally, I'd like Newseagull to take over some of the services run on Eagle and Seagull, and do it almost seemlessly (with very little downtime). So I want to rsync the stuff to get the files on newseagull and set it to sync frequently until downtime can be arranged and I can take them all down, change hostnames, change default services in rc.conf, and re-link NFS/AMD stuff. newseagull will then be numero uno on the network.

Then afterwards Eagle and Seagull will be rsyncing critical service config files so that they can take over some services for Newseagull if it goes down.

Recently the main sshd/mail/DNS/backup/NIS server died and now the bosses are paranoid and want lots and lots of redundancy. Can you tell?

Anyway, I hear the new versions of rsync use SSH by default, which is good because rsh is disabled on this network. I keep trying to grab files with:

rsync -avz remote_host:/path /path_on_localhost

But that doesn't work. Wouldn't I need -rpog to do recursive and preserve ownerships?

I really just need to get a working rsync command to either sync from remote to local or from local to remote. I'm not sure if I should be running an rsync server on one of these boxes or if I can just get it done with rsync commands and cron jobs.

Permission may be an issue. Root has no rights across the network with SSH, so I'm working as a regular user. Should I create an rsync user?

I can scp files around usually, so that at least is a good sign.

arkaine23
12-04-2003, 09:31 PM
I keep getting permission errors.

evac-q8r
12-04-2003, 11:07 PM
In order to make rsync work, it must be installed on both machines.

EVAC

arkaine23
12-04-2003, 11:13 PM
In the case of rsync pulling from seagull to newseagull, I think there is a version mismatch. Seagull runs an older FreeBSD 4.8, while Newseagull is 5.1. I'll check on the versions, but odds are I need to update Seagull's rsync.

I'm about to test out some commands on Eagle/Newseagull and see if I can get it working. I know both of those have the same version.

arkaine23
12-04-2003, 11:18 PM
rsync -arpogvz eagle:/data/fold2 /home2
Enter passphrase for key '/home/troyw/.ssh/id_dsa':
receiving file list ... done
rsync: recv_generator: mkdir "fold2": Permission denied (2)
stat fold2 : No such file or directory
rsync: recv_generator: mkdir "fold2/work": No such file or directory (2)
stat fold2/work : No such file or directory
mkstemp fold2/.FAH3Console.6loRb1 failed: No such file or directory
mkstemp fold2/.FAH3Console.core.xYFKnn failed: No such file or directory
mkstemp fold2/.FAHlog-Prev.txt.3aRud1 failed: No such file or directory
mkstemp fold2/.FAHlog.txt.g1DL2j failed: No such file or directory
mkstemp fold2/.FahCore_65.exe.5O7D3D failed: No such file or directory
mkstemp fold2/.FahCore_78.exe.41cEKW failed: No such file or directory
mkstemp fold2/.MyFolding.html.nKVUOb failed: No such file or directory
mkstemp fold2/.client.cfg.ctqCdg failed: No such file or directory
mkstemp fold2/.machinedependent.dat.w3PJYI failed: No such file or directory
mkstemp fold2/.queue.dat.U5M9g5 failed: No such file or directory
mkstemp fold2/.unitinfo.txt.70IvKW failed: No such file or directory
mkstemp fold2/work/.core78.sta.KXMvro failed: No such file or directory
mkstemp fold2/work/.current.xyz.UARJzj failed: No such file or directory
mkstemp fold2/work/.logfile_00.txt.zjTnkv failed: No such file or directory
mkstemp fold2/work/.wudata_00.arc.IRMQJD failed: No such file or directory
mkstemp fold2/work/.wudata_00.bed.1xIsaB failed: No such file or directory
mkstemp fold2/work/.wudata_00.bxv.PDKPOP failed: No such file or directory
mkstemp fold2/work/.wudata_00.chk.0jluzV failed: No such file or directory
mkstemp fold2/work/.wudata_00.dat.AIm1tb failed: No such file or directory
mkstemp fold2/work/.wudata_00.dyn.T27o5B failed: No such file or directory
mkstemp fold2/work/.wudata_00.goe.WARRam failed: No such file or directory
mkstemp fold2/work/.wudata_00.log.wo5FMd failed: No such file or directory
mkstemp fold2/work/.wudata_00.sas.02oTu9 failed: No such file or directory
mkstemp fold2/work/.wudata_00.xtc.X5AmD5 failed: No such file or directory
mkstemp fold2/work/.wudata_00.xyz.HT6kHm failed: No such file or directory
mkstemp fold2/work/.wudata_00CP.arc.y6ELr5 failed: No such file or directory
mkstemp fold2/work/.wuinfo_00.dat.DARgcE failed: No such file or directory
rsync: recv_generator: mkdir "fold2": Permission denied (2)
stat fold2 : No such file or directory
rsync: recv_generator: mkdir "fold2/work": No such file or directory (2)
stat fold2/work : No such file or directory
wrote 448 bytes read 3096555 bytes 364353.29 bytes/sec
total size is 10162500 speedup is 3.28
rsync error: some files could not be transferred (code 23) at main.c(1045)

arkaine23
12-04-2003, 11:27 PM
rsync -arpogvz /home2/ eagle:/data/fold2/

Well that worked to send local test files to the remote machine, but I can't get it to work the other way.

Now if I wanted to cron this, I'd need to setup the /usr/local/etc/rsyncd.conf and make a secret file for the rsync user's password..... I think that's what I should focus on because my user doesn't seem to have the right permissions to access most of the files I need to rsync.

I'm able to move files I own across directories I own. So how do I move files and folders owned by root when root has not ssh key. Can I make rsync run as root but use a user's ssh key for the tunnel? The other alternative is to allow passwordless SSH for root by generating id_dsa keys for each server, but that seems like a big no-no to me from a security standpoint.