orangesquid ([info]os) wrote,
@ 2008-09-24 08:36:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Entry tags:copland, imap, rsync, udel

What they don't tell you about leaving UD
Step 1: give out new e-mail address
os@copland:~$ pine `echo $(grep -v '^ ' ~/.addressbook|cut -d' ' -f1)|tr ' ' ','` #note, '^ ' has 3 spaces, and -d' ' is a single tab

Step 2: get list of /tmp files on other systems (since verdi, vivaldi, haydn, and schubert aren't reachable from the outside world) and make some local tarballs
os@copland:~$ for host in strauss verdi vivaldi haydn schubert ; do ssh $host touch /tmp/`whoami`.all-files.tar ';' /opt/sfw/bin/gfind /tmp -type f -user `whoami` -print0 '|' /opt/sfw/bin/gxargs -0 -n 1024 tar rvf /tmp/`whoami`.all-files.tar -C /tmp 2>&1 | grep -v 'Permission denied' ; scp $host:/tmp/`whoami`.all-files.tar /tmp/`whoami`.all-files.$host.tar ; done

Step 3: tarball local files in /tmp
os@copland:~$ touch /tmp/`whoami`.all-files.tar ; /opt/sfw/bin/gfind /tmp -type f -user `whoami` -print0 | /opt/sfw/bin/gxargs -0 -n 1024 tar rvf /tmp/`whoami`.all-files.tar -C /tmp 2>&1 | grep -v 'Permission denied' ; bzip2 /tmp/`whoami`.all-files.tar

Step 4: transfer these files to someplace local
os@erinaceous:~$ UDEL_USERNAME=os ; scp $UDEL_USERNAME@copland.udel.edu:/tmp/$UDEL_USERNAME.all-files.tar udel-tmp-files.tar.bz2

Step 5: sync your home directory to someplace local
os@erinaceous:~$ UDEL_USERNAME=os ; rsync -P -avz -e ssh $UDEL_USERNAME@copland.udel.edu:~ udel-home

Step 6: sync your IMAP folders locally with mailsync
#!/bin/bash
# warning, this has not actually been tested, just written from my notes
# syncs IMAP folders to $HOME/mail/udel-sync/
UDEL_USERNAME=os
if [ ! -d imap-2007b ] ; then
echo get imap-2007b.tar.Z | lftp ftp.cac.washington.edu:/imap
if [ ! -e imap-2007b.tar.Z ] ; then
echo COULD NOT DOWNLOAD IMAP, please fetch it manually
exit 1
fi
uncompress imap-2007b.tar.Z
tar xf imap-2007b.tar
fi
if [ ! -e imap-2007b/c-client/osdep.o -o ! -e imap-2007b/c-client/c-client.a ] ; then
pushd imap-2007b
if [ `uname -s` = Linux ] ; then
if [ -e /etc/slackware-version] ; then
make slx SSLDIR=/usr \
SSLCERTS=/etc/ssl/certs SSLINCLUDE=/usr/include/openssl
elif [ -e /lib/libpam.so ] ; then
make lnp
else
make lrh
fi
elif [ `uname -s` = SunOS ] ; then
if which gcc ; then
make gso
else
make soc
fi
elif [ -d /etc/init.d ] ; then
make lnx || make a32
elif [ -d /etc/rc.d -o -f /etc/rc.local ] ; then
make bsi || make mct || make nxt
else
make gsg || make sv4 || make vul
fi
if [ ! -e c-client/osdep.o -o ! -e c-client/c-client.a ] ; then
echo COULD NOT COMPILE IMAP, please build it manually
exit 1
fi
popd
fi
if [ ! -d mailsync-5.2.1 ] ; then
wget http://downloads.sf.net/mailsync/mailsync_5.2.1.orig.tar.gz
if [ ! -e mailsync_5.2.1.orig.tar.gz ] ; then
echo COULD NOT DOWNLOAD MAILSYNC, please fetch it manually
exit 1
fi
gunzip mailsync_5.2.1.orig.tar.gz
tar xf mailsync_5.2.1.orig.tar
fi
if [ ! -x mailsync-5.2.1/src/mailsync ] ; then
pushd mailsync-5.2.1
./configure --with-c-client=`pwd`/../imap-2007b/c-client \
--with-openssl && make
if [ ! -x src/mailsync ] ; then
echo COULD NOT COMPILE MAILSYNC, please build it manually
exit 1
fi
popd
fi
pushd mailsync-5.2.1
cat > udel-imap-conf << EOF
store udel-imap {
server {mail.udel.edu/user=$UDEL_USERNAME/ssl/novalidate-cert}
ref {udel.edu}
pat *
}

store local-mail {
pat mail/udel-sync/%
prefix mail/udel-sync/
}

channel udel-imap-sync udel-imap local-mail {
msinfo mail/sync/sync-info
}
EOF
cat > do-udel-sync << EOF
src/mailsync -cd -n -d -dc -v -vw -vb -vp -m -M -di -f udel-imap-conf \
udel-imap-sync
EOF
sh do-udel-sync
sh do-udel-sync
popd




Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…