From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/20020 Path: main.gmane.org!not-for-mail From: Kai.Grossjohann@CS.Uni-Dortmund.DE Newsgroups: gmane.emacs.gnus.general Subject: Re: synchronizing desktop machine and laptop Date: 24 Dec 1998 08:44:31 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: <863e66vva8.fsf@slowfox.cs.uni-dortmund.de> References: <199812240432.XAA15300@math.gatech.edu> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 X-Trace: main.gmane.org 1035158318 14950 80.91.224.250 (20 Oct 2002 23:58:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:58:38 +0000 (UTC) Return-Path: Original-Received: from karazm.math.uh.edu (karazm.math.uh.edu [129.7.128.1]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id DAA26644 for ; Thu, 24 Dec 1998 03:47:49 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by karazm.math.uh.edu (8.9.1/8.9.1) with ESMTP id CAB09633; Thu, 24 Dec 1998 02:47:36 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 24 Dec 1998 02:45:27 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id CAA07493 for ; Thu, 24 Dec 1998 02:45:13 -0600 (CST) Original-Received: from waldorf.cs.uni-dortmund.de (waldorf.cs.uni-dortmund.de [129.217.4.42]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id DAA26598 for ; Thu, 24 Dec 1998 03:45:03 -0500 (EST) Original-Received: from ramses.informatik.uni-dortmund.de (ramses.cs.uni-dortmund.de [129.217.20.180]) by waldorf.cs.uni-dortmund.de with SMTP id JAA18974 for ; Thu, 24 Dec 1998 09:18:18 +0100 (MET) Original-Received: (grossjoh@localhost) by ramses.informatik.uni-dortmund.de id JAA09852; Thu, 24 Dec 1998 09:18:17 +0100 Original-To: ding@gnus.org In-Reply-To: Richard Coleman's message of "Wed, 23 Dec 1998 23:32:10 -0500" User-Agent: Gnus/5.070068 (Pterodactyl Gnus v0.68) Emacs/20.3 Precedence: list X-Majordomo: 1.94.jlt7 Original-Lines: 182 Xref: main.gmane.org gmane.emacs.gnus.general:20020 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:20020 Richard Coleman 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 -- | # ------------------------------------------------------------ | # Copies one directory from to | | 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