From: Kai.Grossjohann@CS.Uni-Dortmund.DE
Subject: Re: synchronizing desktop machine and laptop
Date: 24 Dec 1998 08:44:31 +0100 [thread overview]
Message-ID: <863e66vva8.fsf@slowfox.cs.uni-dortmund.de> (raw)
In-Reply-To: Richard Coleman's message of "Wed, 23 Dec 1998 23:32:10 -0500"
Richard Coleman <coleman@math.gatech.edu> writes:
> What method are people using to keep their laptop and desktop
> machine in synch?
Well, I have two desktop machines, but one is at home via a dialup
link, so the problem is the same :-)
I use rsync. I do `uni get' to retrieve mail from work, then at home
I do M-x gnus-unplugged RET. When I'm finished with mail stuff, I do
`uni put'.
This script calls `unimail' and `uniemm', where `unimail' synchronizes
the mail files and directories, and `uniemm' fetches new mail and
sends queued mail and stuff at the remote end.
Suppose my user name is `kaihome' with home dir /home/kaihome at home
and it is `kaiwork' with home dir /home/kaiwork at work. Then:
,----- unimail
| #!/bin/sh
|
| AH="kaiwork@work:/home/kaiwork"
| DO="-av --delete --exclude Incoming*"
| CFG="--rsh ssh --rsync-path /home/kaiwork/bin/rsync"
|
| # ------------------------------------------------------------
| # -- dorsync <source> <target> --
| # ------------------------------------------------------------
| # Copies one directory from <source> to <target>
|
| dorsync ()
| {
|
| echo rsync $DO $CFG $1 $2
| rsync $DO $CFG $1 $2
|
| }
|
| # ------------------------------------------------------------
| # -- get --
| # ------------------------------------------------------------
| # Retrieves mail from uni
|
| get ()
| {
|
| dorsync $AH/.newsrc $HOME/.newsrc
| dorsync $AH/.newsrc.eld $HOME/.newsrc.eld
| dorsync $AH/.nnmail-cache $HOME/.nnmail-cache
| dorsync $AH/Mail/ $HOME/Mail/
| dorsync $AH/News/ $HOME/News/
|
| }
|
| # ------------------------------------------------------------
| # -- put --
| # ------------------------------------------------------------
| # Uploads mail to uni
|
| put ()
| {
|
| dorsync $HOME/.newsrc $AH/.newsrc
| dorsync $HOME/.newsrc.eld $AH/.newsrc.eld
| dorsync $HOME/.nnmail-cache $AH/.nnmail-cache
| dorsync $HOME/Mail/ $AH/Mail/
| dorsync $HOME/News/ $AH/News/
|
| }
|
| # ------------------------------------------------------------
| # -- Util functions --
| # ------------------------------------------------------------
|
| usage ()
| {
|
| echo "Usage: $0 ( get | put )"
| echo "Synchronizes mail with uni."
| echo "Get means download, put means upload."
| exit 1
|
| }
|
| # ------------------------------------------------------------
| # -- Main program --
| # ------------------------------------------------------------
|
| if [ $# != 1 ] ; then
| usage
| fi
|
| case $1 in
| get)
| get
| ;;
| put)
| put
| ;;
| *)
| usage
| esac
`-----
,----- uniemm
| #!/bin/sh
|
| ssh -l kaiwork work /usr/sw/emacs/20.3/bin/emacs \
| -batch -l site-start -l .emacs.custom \
| -f do-some-startup \
| -l .emacs -l gnus -l .gnus -l gnus-agent -f kai-gnus-agent-do
`-----
,----- uni
| #!/bin/sh
|
| case "$1" in
| get)
| echo "`date`: Getting mail from Uni"
| start=`date`
| isdnctrl dial ippp0
| sleep 5
| uniemm
| unimail get
| isdnctrl hangup ippp0
| echo "${start}: Started getting mail from Uni"
| echo "`date`: Done getting mail from Uni"
| ;;
| put)
| echo "`date`: Sending mail to Uni"
| start=`date`
| isdnctrl dial ippp0
| sleep 5
| unimail put
| uniemm
| unimail get
| isdnctrl hangup ippp0
| echo "${start}: Started sending mail to Uni"
| echo "`date`: Done sending mail to Uni"
| ;;
| *)
| echo "Usage: $0 (get|put)"
| echo " get: connects to uni, gets new mail, downloads mail."
| echo " put: uploads changes, connects to uni, sends queued"
| echo " messages, then like get."
| exit 1
| ;;
| esac
`-----
As you can see, the script uniemm calls a function, which is defined
as follows in my .emacs:
,-----
| (defun kai-gnus-agent-do ()
| (let ((gnus-verbose 5))
| (message "Kai: fetching Agent session.")
| (flet ((y-or-n-p (prompt) t)
| (yes-or-no-p (prompt) t))
| (gnus-agent-batch))
| ;(gnus-agent-fetch-session)
| (message "Kai: starting Gnus")
| (gnus)
| (message "Kai: sending drafts")
| (gnus-group-send-drafts)
| (message "Kai: fetching agent stuff")
| (gnus-agent-batch)
| (message "Kai: exiting Gnus")
| (gnus-group-exit)
| (save-buffers-kill-emacs t)))
`-----
All of this is a bit complicated, but it seems to work.
I'm also thinking about using IMAP, but I don't know the state of
affairs with respect to disconnected operation.
kai
--
This gubblick contains many nonsklarkish English flutzpahs,
but the overall pluggandisp can be glorked from context. -- David Moser
next prev parent reply other threads:[~1998-12-24 7:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-24 4:32 Richard Coleman
1998-12-24 7:44 ` Kai.Grossjohann [this message]
1998-12-24 13:15 ` William M. Perry
1998-12-24 15:59 ` Karl Kleinpaste
1998-12-24 17:01 ` William M. Perry
1998-12-24 21:09 ` Aaron M. Ucko
1998-12-25 0:15 ` Simon Josefsson
1998-12-26 16:46 ` Wes Hardaker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=863e66vva8.fsf@slowfox.cs.uni-dortmund.de \
--to=kai.grossjohann@cs.uni-dortmund.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).