Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: Teviot on June 22, 2010, 04:55:04 AM

Title: Sync a file from a remote SME to local SME
Post by: Teviot 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
Title: Re: Sync a file from a remote SME to local SME
Post by: Franco 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,

Title: Re: Sync a file from a remote SME to local SME
Post by: Teviot 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?
Title: Re: Sync a file from a remote SME to local SME
Post by: cactus 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.
Title: Re: Sync a file from a remote SME to local SME
Post by: mmccarn 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?
Title: Re: Sync a file from a remote SME to local SME
Post by: cactus 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... :-)
Title: Re: Sync a file from a remote SME to local SME
Post by: warren 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.