Koozali.org: home of the SME Server

Sync a file from a remote SME to local SME

Offline Teviot

  • *
  • 610
  • +0/-0
Sync a file from a remote SME to local SME
« on: June 22, 2010, 04:55:04 AM »
Is there a way of sync'ing a file in a information bay on a remote SME server to a information bay on a local SME server?

I need to keep an up to date copy of a particulatar file for my work.  I think I have heard of it being done some time ago but don't remember what it was called or if it really exsists

Please help
Regards
M0GLJ
......................................................
I am new to SAIL SME Server v8b6 and have been using SME for many years.
I have already done some research and only ask questions if I still can't work it out.

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Re: Sync a file from a remote SME to local SME
« Reply #1 on: June 22, 2010, 05:10:43 AM »
Hi,
Code: [Select]
rsync -C -r -a -v -z -p /home/e-smith/files/ibays/BLA-BLA/* root@172.16.0.9:/Your_directory_of_backup/
HTH,


Offline Teviot

  • *
  • 610
  • +0/-0
Re: Sync a file from a remote SME to local SME
« Reply #2 on: June 22, 2010, 05:51:29 AM »
Hi,
Code: [Select]
rsync -C -r -a -v -z -p /home/e-smith/files/ibays/BLA-BLA/* root@172.16.0.9:/Your_directory_of_backup/
HTH,



Thank you

Which machine is this set up on and will that keep any modifications to the file automatically updated on the 2nd SME server?
Regards
M0GLJ
......................................................
I am new to SAIL SME Server v8b6 and have been using SME for many years.
I have already done some research and only ask questions if I still can't work it out.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Sync a file from a remote SME to local SME
« Reply #3 on: June 22, 2010, 07:28:50 AM »
Which machine is this set up on and will that keep any modifications to the file automatically updated on the 2nd SME server?
This is run on the machine the file is originally stored on and is only a one direction sync IIRC. Please keep in mind that the kind of thing you are after can only be done on SME Server by using some sort of version control as there is no conflict resolution in rsync, it is just a program that does copy files to and from.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Sync a file from a remote SME to local SME
« Reply #4 on: June 22, 2010, 05:55:58 PM »
cactus - does the recommended rsync syntax tunnel the connection over ssh, or are there any other security measures that should be addressed such as setting 'AllowHosts' for rsync on the remote computer or something like that?

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Sync a file from a remote SME to local SME
« Reply #5 on: June 22, 2010, 06:33:30 PM »
cactus - does the recommended rsync syntax tunnel the connection over ssh, or are there any other security measures that should be addressed such as setting 'AllowHosts' for rsync on the remote computer or something like that?
I am not sure, I suggest you test it... :-)
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline warren

  • *
  • 293
  • +0/-0
Re: Sync a file from a remote SME to local SME
« Reply #6 on: June 23, 2010, 09:52:27 AM »
cactus - does the recommended rsync syntax tunnel the connection over ssh, or are there any other security measures that should be addressed such as setting 'AllowHosts' for rsync on the remote computer or something like that?

Pull files from remote SME to a local SME using rsync over ssh with public private keys, and remote SME using non standard ssh port :

Code: [Select]
rsync -avz -e 'ssh -2 -p 26295 -i /path_to_private_keyFile_of_remoteSME' root@xxx.xxx.xxx.xxx:/home/e-smith/files/ibays/something/html/ /home/e-smith/files/ibays/something/html
This works without having to change any other settings.