LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 06-07-2010, 06:42 AM   #1
edderkop
LQ Newbie
 
Registered: Aug 2007
Location: Stuttgart, Germany
Distribution: Debian, Ubuntu, Darwin, FreeBSD
Posts: 18

Rep: Reputation: 0
unison/iwatch sync - files disappearing from server


Hi all

I'm trying to set up a synchronization with unison and iwatch to (more or less) instantly sync files upon change in a directory tree.

iwatch calls unison like this:

Code:
unison /home/foo/vhosts/foo/my_vhost/bar.html ssh://server.tld//srv/www/vhosts/foo/bar.html -batch -terse -ui text -owner -group
I would expect unison to sync all files between the two servers. However, that is not the case. Everything works fine as long as the files are only created/changed/whatever on the server running unison. If a file is created on the server that unison is synchronizing to, it gets deleted the next time unison is called.

For example:

Code:
on the host running unison:

$ cd /home/foo/vhosts/foo/my_vhost
$ touch foo.bar

-- sshing to remote host ---

$ ssh remote.com
$ cd /srv/www/vhosts/foo
$ touch hello_world.html
$ exit

-- back on the server running unison --

$ unison /home/foo/vhosts/foo/my_vhost/foo.bar ssh://remote.com//srv/www/vhosts/foo/foo.bar -batch -terse -ui text -owner -group
I expected that both files get synchronized - foo.bar from the unison server to remote.com and hello_world.html from remote.com to the server running unison. Instead, hello_world.html gets deleted.

I've been working a while on this and don't seem to be able to figure it out. Maybe it's only an argument to unison to rectify it but I couldn't find anything adequate in the manpage either.

Any help will be greatly appreciated. TIA!

edderkop
 
Old 06-08-2010, 06:24 AM   #2
edderkop
LQ Newbie
 
Registered: Aug 2007
Location: Stuttgart, Germany
Distribution: Debian, Ubuntu, Darwin, FreeBSD
Posts: 18

Original Poster
Rep: Reputation: 0
I was able to figure it out. I had a second synchronization process running - a different solution that I'd tried before (lsyncd) before giving up and using iwatch/unison. I'd totally forgotten that that process was still running. After killing it everything worked as expected. :-)
 
Old 06-08-2010, 07:13 AM   #3
halvy
Member
 
Registered: Aug 2005
Location: Boston Massachussets, USA
Distribution: Anything NOT SystemD (ie. M$) related.
Posts: 917

Rep: Reputation: 41
Thumbs up

Glad to see you figured it out so quickly.

I just thought I'd add, for future reference that I used Unison for awhile..and found it 'ok' to get your feet wet in learning about Rsync..

After a lot of frustration with Unison.. it's lack of features, overwhelming use of terms that NOONE has a clue to what they EXACTLY mean, and the fact that it is not supported anymore (I think).. I just took the time to learn about using Rsync alone.

It's manual is cleaner and more easily understood... even tho it is basically the same otherwise as Rsyncs.

For instance, with the issue you were having.. the adding of the --delete switch would have been the cause of your problems.. however, (I think) that the ONLY way you could have REMOVED this switch from UNISON, would be to run it from the command line... which, at this point, you might as well do away with all the fluff & guff.. and go straight to using Rsync.

Anyways.. good luck in the future with your work & projects
 
  


Reply

Tags
unison


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Samba Share and Mac OS X - Files Disappearing? klugenratte Linux - Software 15 12-25-2011 11:58 PM
[SOLVED] how do I make unison transfer newer files during sync? ratgod Linux - Software 2 05-24-2010 02:18 PM
Iwatch problem saran_redhat Linux - Newbie 18 10-27-2009 04:29 AM
Unison setup - or other file sync software m_a_b Linux - Software 1 06-15-2008 10:29 AM
Unison has found/created odd named files. I'm also after basic syncing advice. Mysticle31 Linux - Server 0 01-16-2008 11:50 AM


All times are GMT -5. The time now is 02:03 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration