[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New to linux on laptops - A few Q's



On Fri, 17 Sep 1999, Stephane Bortzmeyer wrote:

> On Thursday 16 September 1999, at 16 h 45, the keyboard of "CHRIS HOOVER" 
> <CWH54@dirm.dmh.state.sc.us> wrote:
> 
> > stuff.  I told it to do so and also had it setup getty for the serial parts
> > (my modem). 
> 
> It is quite uncommon for a laptop: you really want to call your laptop? Most 
> of the time, laptops are just used as callers, not callees, and thus don't 
> need getty.

You don't need getty *on the modem*.  You will probably be running it on
some virtual terminals, though.  At least, that's how it ended up on my
laptop after installing debian.
 
> > Also, I'd like to be able to sync my laptop with my home server. 

This must be a common desire.  Using straight file copying (or rsync,
etc) is fine for ordinary files.  But what about mail?  

I have a large bunch of mail folders on my home machine.  When I travel, I
turn off my home machine, and have the laptop masquerade as it, so as to
receive email on the laptop.  That's fine until I return home.  Now I have
to merge all these mail folders.  My current solution is to append via

	cd mail
	foreach folder in *; do		
		cat /net/laptop/.../mail/$folder >> $folder
	done

and then delete duplicates, since the laptop's mail/$folder might have
stuff left from the previous travel, which is already present in my home
machine's mail/$folder.

There's got to be a better way.  Ideas?

 
> rsync and cvs are two solutions I use, depending on the exact problem. 
>
> rsync is very fast for transferring a lot of data, specially if only a
> small part of it changed. You can resynchronize two huge hard disks
> very fast. Its main problem is that it is assymetric: one side of the
> link has the good data, the other is clobbered if necessary.

True.  I have made a script that essentially does an rsync in each
direction, overwriting a file only if it is newer than the copy being
overwritten.  This allows me to share a hierarchy between two machines,
if:

  1. the machine's clocks are reasonably well synchronized, and
  2. you don't modify a file on both ends between synchronization

And if you mess up with (2), a backup copy is saved for you to merge the
changes on both ends, by hand.

Here's my script.  [I'm hoping this inspires someone to show me how to do
it in a much better way!]


#!/bin/sh
#
# Synchronize a common hierarchy.
#
# - if file X at home is newer, the old copy at cgm is renamed to X.cgm
# - if file X at cgm is newer, the old copy at home is renamed to X.home
# - backup files ending in .cgm, .home, or ~ are ignored

opts="--archive --compress --update --backup"
opts="${opts} --verbose"
excl="--exclude '*~' --exclude '*.cgm' --exclude '*.home'"

# I put the 'eval' here because otherwise the single quotes in $opts and $excl
# get quoted again!  '*~' --> ''\''*~\'''
# (hence the pattern doesn't match what I wanted it to match)

eval rsync $opts $excl --suffix .cgm . stever@jeff:share/
eval rsync $opts $excl --suffix .home stever@jeff:share/ .




Reply to: