Re: [OT] file synchronization between two machines

2003-03-25 Thread Dan Nelson
In the last episode (Mar 25), Louis LeBlanc said:
 That sounds right, but what if the file last changed on the remote
 machine?  Will rsync copy the newer remote copy to the local machine
 when necessary and copy the newer local copy to the remote machine
 when necessary?  This is the problem, really.  Running rsync on both
 machines won't do any good, because the remote machine can't come
 thru the firewall.

You run it on one machine twice, once for each direction.  From the
manpage:

  To synchronize my samba source trees I use the following:
  rsync -avuzb --exclude '*~' samba:samba/ .
  rsync -Cavuzb . samba:samba/
 

The only drawback is rsync will never delete files; you have to
manually remove them from both machines manually.

-- 
Dan Nelson
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: [OT] file synchronization between two machines

2003-03-25 Thread Dan Nelson
In the last episode (Mar 25), John Straiton said:
  The only drawback is rsync will never delete files; you have to 
  manually remove them from both machines manually.
 
 It wouldn't be near as neat a utility if that were true (unless I
 misunderstood your statement).

You might have.  For correct two-way replication, you need a history
file that records the state of the filesystem as of the last time the
replication ran.  Otherwise you won't know whether the file1 is on
serverA but not on ServerB case is due to the user creating a new
file1 on serverA, or deleting an old file1 from ServerB.

Rsync doesn't keep a history file, so all it can do it copy file1 over
to serverB.

-- 
Dan Nelson
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: [OT] file synchronization between two machines

2003-03-25 Thread Doug Hardie
On Tuesday, Mar 25, 2003, at 08:01 US/Pacific, Louis LeBlanc wrote:

Hey all.  Sorry for the OT question, but here goes.

Anyone know of a tool or method that can check the last modification
date of two files under these conditions and keep them in sync?
I've never tried this, but you might give rsync with the -u option a 
try (test it first on unimportant files).  I believe you would need to 
run it on both machines as it would only update in one direction.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: [OT] file synchronization between two machines

2003-03-25 Thread Giorgos Keramidas
On 2003-03-25 11:01, Louis LeBlanc [EMAIL PROTECTED] wrote:
 Hey all.  Sorry for the OT question, but here goes.

 I have several documents that I modify on two different machines.  Of
 course, before I start work on one machine, I have to remember where I
 last modified it, and if necessary, copy it over.

 I'd like to automate this process.  I know rdist is supposed to do
 something like this, but as I understand it, it only works for files
 modified in a centralized location.

 To further complicate things, communication between the two machines
 is strictly one sided.  One machine is behind a firewall that doesn't
 have an opening for the second.  I haven't yet had time to set up a
 tunnel between the two to remedy that, but ssh access the other way is
 trivial.

 Anyone know of a tool or method that can check the last modification
 date of two files under these conditions and keep them in sync?

If these documents are text-only or at least test-based (no binary
formats, like .doc, .pdf or whatever), this is a situation that
screams Use CVS! Use CVS! :)

- Giorgos


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


RE: [OT] file synchronization between two machines

2003-03-25 Thread Yonatan Bokovza
 -Original Message-
 From: Doug Hardie [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 25, 2003 18:10
 To: [EMAIL PROTECTED]
 Subject: Re: [OT] file synchronization between two machines
 
 
 
 On Tuesday, Mar 25, 2003, at 08:01 US/Pacific, Louis LeBlanc wrote:
 
  Hey all.  Sorry for the OT question, but here goes.
 
  Anyone know of a tool or method that can check the last modification
  date of two files under these conditions and keep them in sync?
 
 I've never tried this, but you might give rsync with the -u option a 
 try (test it first on unimportant files).  I believe you 
 would need to 
 run it on both machines as it would only update in one direction.

rsync (from ports/net/rsync) does not need a peer on the other side.
You can think of is as a clever scp- you can copy to/from one server
to/from another server, only rsync can sync files on the block level, 
so it's supposed to be more efficient than merely copying the files over.
For your case, I'd say run a cron job at the firewalled machine to rsync
the files over to the other one.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: [OT] file synchronization between two machines

2003-03-25 Thread Adam Maas
- Original Message - 
From: Louis LeBlanc [EMAIL PROTECTED]
To: FreeBSD Questions [EMAIL PROTECTED]
Sent: Tuesday, March 25, 2003 11:01 AM
Subject: [OT] file synchronization between two machines


 Hey all.  Sorry for the OT question, but here goes.
 
--SNIP--
 
 Anyone know of a tool or method that can check the last modification
 date of two files under these conditions and keep them in sync?
 
 Thanks
 Lou
 -- 

Try rsync.

Adam


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: [OT] file synchronization between two machines

2003-03-25 Thread Louis LeBlanc
On 03/25/03 06:40 PM, Yonatan Bokovza sat at the `puter and typed:
  On Tuesday, Mar 25, 2003, at 08:01 US/Pacific, Louis LeBlanc wrote:
  
   Hey all.  Sorry for the OT question, but here goes.
  
   Anyone know of a tool or method that can check the last modification
   date of two files under these conditions and keep them in sync?
  
  I've never tried this, but you might give rsync with the -u option a 
  try (test it first on unimportant files).  I believe you 
  would need to 
  run it on both machines as it would only update in one direction.
 
 rsync (from ports/net/rsync) does not need a peer on the other side.
 You can think of is as a clever scp- you can copy to/from one server
 to/from another server, only rsync can sync files on the block level, 
 so it's supposed to be more efficient than merely copying the files over.
 For your case, I'd say run a cron job at the firewalled machine to rsync
 the files over to the other one.

That sounds right, but what if the file last changed on the remote
machine?  Will rsync copy the newer remote copy to the local machine
when necessary and copy the newer local copy to the remote machine
when necessary?  This is the problem, really.  Running rsync on both
machines won't do any good, because the remote machine can't come
thru the firewall.

I had already thought of another recommendation to use CVS, but that
wouldn't work because the files are M$ Word (eww).

Thanks everyone for your replies

Lou
-- 
Louis LeBlanc   [EMAIL PROTECTED]
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org ԿԬ

Sacher's Observation:
  Some people grow with responsibility -- others merely swell.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


RE: [OT] file synchronization between two machines

2003-03-25 Thread Yonatan Bokovza
 -Original Message-
 From: Louis LeBlanc [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 25, 2003 18:57
 To: [EMAIL PROTECTED]
 Subject: Re: [OT] file synchronization between two machines
 
 
 On 03/25/03 06:40 PM, Yonatan Bokovza sat at the `puter and typed:
   On Tuesday, Mar 25, 2003, at 08:01 US/Pacific, Louis 
 LeBlanc wrote:
   
Hey all.  Sorry for the OT question, but here goes.
   
Anyone know of a tool or method that can check the last 
 modification
date of two files under these conditions and keep them in sync?
   
   I've never tried this, but you might give rsync with the 
 -u option a 
   try (test it first on unimportant files).  I believe you 
   would need to 
   run it on both machines as it would only update in one direction.
  
  rsync (from ports/net/rsync) does not need a peer on the other side.
  You can think of is as a clever scp- you can copy to/from one server
  to/from another server, only rsync can sync files on the 
 block level, 
  so it's supposed to be more efficient than merely copying 
 the files over.
  For your case, I'd say run a cron job at the firewalled 
 machine to rsync
  the files over to the other one.
 
 That sounds right, but what if the file last changed on the remote
 machine?  Will rsync copy the newer remote copy to the local machine
 when necessary and copy the newer local copy to the remote machine
 when necessary?  This is the problem, really.  Running rsync on both
 machines won't do any good, because the remote machine can't come
 thru the firewall.
 
 I had already thought of another recommendation to use CVS, but that
 wouldn't work because the files are M$ Word (eww).

Read it's man page:
http://www.freebsd.org/cgi/man.cgi?query=rsyncapropos=0sektion=0manpath=FreeBSD+Ports+4.7-RELEASEformat=html

you can do this at the firewalled machine
(examples only, not real commands) :
rsync -u [EMAIL PROTECTED]:file file
rsync -u file [EMAIL PROTECTED]:file

This will guarantee that file is the same on both machines.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


RE: [OT] file synchronization between two machines

2003-03-25 Thread John Straiton
 The only drawback is rsync will never delete files; you have
 to manually remove them from both machines manually.

It wouldn't be near as neat a utility if that were true.

From the man page for rsync:

--deletedelete files that don't exist on
the sending side
--delete-excluded   also delete excluded files on the
receiving side
--delete-after  delete after transferring, not
before
--ignore-errors delete even if there are IO
errors

John Straiton
[EMAIL PROTECTED]
Clickcom, Inc
704-365-9970x101 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


RE: [OT] file synchronization between two machines

2003-03-25 Thread John Straiton
 The only drawback is rsync will never delete files; you have to 
 manually remove them from both machines manually.

It wouldn't be near as neat a utility if that were true (unless I
misunderstood your statement).

From the man page for rsync:

--deletedelete files that don't exist on
the sending side
--delete-excluded   also delete excluded files on the
receiving side
--delete-after  delete after transferring, not
before
--ignore-errors delete even if there are IO
errors

John Straiton
[EMAIL PROTECTED]
Clickcom, Inc
704-365-9970x101 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: [OT] file synchronization between two machines

2003-03-25 Thread Oliver Braun
* Louis LeBlanc [EMAIL PROTECTED] [2003-03-25 11:01 -0500]:
 Anyone know of a tool or method that can check the last modification
 date of two files under these conditions and keep them in sync?

Try unison[1][2]. I love it.

Regards,
 Olli

1. http://www.cis.upenn.edu/~bcpierce/unison/
2. ${PORTSDIR}/net/unison/
-- 
Oliver Braun :: [EMAIL PROTECTED] :: [EMAIL PROTECTED]


pgp0.pgp
Description: PGP signature


Re: [OT] file synchronization between two machines

2003-03-25 Thread Louis LeBlanc
On 03/25/03 12:23 PM, John Straiton sat at the `puter and typed:
  The only drawback is rsync will never delete files; you have to 
  manually remove them from both machines manually.
 
 It wouldn't be near as neat a utility if that were true (unless I
 misunderstood your statement).
 
 From the man page for rsync:
 
   --deletedelete files that don't exist on
 the sending side
 --delete-excluded   also delete excluded files on the
 receiving side
 --delete-after  delete after transferring, not
 before
   --ignore-errors delete even if there are IO
 errors

Cool.  It also occurred to me that a flag that tells rsync not to copy
files if they aren't already at the destination would be useful.
--existing will do it.

Looking thru the manpage, I see that the -C flag is a cvs style
exclusion.  Is there any reason for using an explicit exclusion in one
command and a CVS style exclusion in the other?
  rsync -avuzb --exclude '*~' samba:samba/ .
  rsync -Cavuzb . samba:samba/

Other than this, I think you've all helped me solve this problem.
Thank you!

Lou
-- 
Louis LeBlanc   [EMAIL PROTECTED]
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org ԿԬ

Technological progress has merely provided us with more efficient means
for going backwards.
-- Aldous Huxley

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message