<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>RsyncNet</title><revhistory><revision><revnumber>2</revnumber><date>2010-10-10 09:38:54</date><authorinitials>noway.chem.columbia.edu</authorinitials><revremark>add link to BackupInfo and database backup info</revremark></revision><revision><revnumber>1</revnumber><date>2010-10-10 09:21:54</date><authorinitials>noway.chem.columbia.edu</authorinitials><revremark>documenting how our backups work</revremark></revision></revhistory></articleinfo><para>This page describes the backup strategy used to back up hcoop.net to rsync.net.  This page is currently a <emphasis>work in progress</emphasis>, and is being used to document the current state of things as they were set up some years ago. </para><para><ulink url="https://wiki.hcoop.net/RsyncNet/BackupInfo#">BackupInfo</ulink> explains things from a how-to perspective. </para><section><title>What happens</title><orderedlist numeration="arabic"><listitem><para>rsync.net ssh's automatically (every three days) to deleuze (user unknown, probably user=rsync and authenticates using pub key in ~rsync/ssh/authorized_keys ) </para></listitem><listitem><para>the shell run by rsync.net is <code>/afs/hcoop.net/common/etc/scripts/rsync-shell</code>.  This shell wrapper allows two commands: <code>backup</code> and <code>rsync</code> with a verified command line.  The shell wrapper logs to <code>/var/log/rsync-shell.log</code> </para></listitem><listitem><para>The first ssh time runs <code>backup</code> which executes <code>sudo /afs/hcoop.net/common/etc/scripts/hcoop-backup-wrapper</code> </para><orderedlist numeration="loweralpha"><listitem><para>The backup wrapper logs to <code>/var/log/backup-to-rsync-wrapper-log</code> </para></listitem><listitem><para>Temporary: exits to abort the backup </para></listitem><listitem><para><code>fs checkvol</code> </para></listitem><listitem><para>k5start to user <code>hcoop</code> </para></listitem><listitem><para>runs <code>/afs/hcoop.net/common/etc/scripts/hcoop-backup</code>, logging to <code>/var/log/backup-to-rsync-log</code> </para><orderedlist numeration="loweralpha"><listitem><para>delete and recreate <code>/vicepa/hcoop-backups/files</code> and a subdirectory for today. </para></listitem><listitem><para>queries dpkg to find a) all files on filesystem (allfiles) b) all files shipped with packages (debfiles) c) all registered config files in packages (conffiles) </para></listitem><listitem><para>take all files in allfiles that aren't in debfiles </para></listitem><listitem><para>exclude various paths which are NOT needed to be backed up (e.g. <code>/var/cache</code>) </para></listitem><listitem><para>Add in all conffiles </para></listitem><listitem><para>Take backupfiles and exclude various paths which we know should be backed up.  What is left is &quot;annoying files&quot; - things to mail the admins about to add to the &quot;expected to be backed up&quot; list or to an exclude list.  This keeps a human in the loop in case extra files appear </para></listitem><listitem><para>Back up everything in this list of files using <code>tar</code>, pipe through <code>ccrypt</code> to encrypt and $MOVE_OVER -  </para></listitem><listitem><para>SPAMD: Wait for a spamd lock to become free, tar and ccrypt <code>/var/local/lib/spamd</code> </para></listitem><listitem><para>VOLUMES: <code>vos listvol deleuze</code>, exclude <code>.backup</code> and <code>.readonly</code>, volumes containing <code>not-backed-up</code>, compress and add to the backup directory </para></listitem><listitem><para>DATABASES: back up databases from <code>/var/backups/databases/</code> (TODO: how do databases get here?  Need to locate that script).   </para></listitem><listitem><para>Change permissions of staging dir and change owner to uid=<code>rsync</code> </para></listitem><listitem><para>Send mail to admins about unexpected files </para></listitem></orderedlist></listitem></orderedlist></listitem><listitem><para>the second time ssh runs (immediately after the first) it runs rsync, with a verified command line, backing up everything placed in <code>/vicepa/hcoop-backups/files/YYYY-MM-DD/</code> to rsync.net, using rsync. </para></listitem><listitem><para>rsync.net maintains the last two dates of backup (so about a week's worth) </para></listitem><listitem><para>non-deleuze systems don't seem to be backed up. </para></listitem></orderedlist><para>Database backups: </para><itemizedlist><listitem><para><code>/etc/cron.daily/hcoop-all-db-backup-to-var</code>, which runs </para></listitem><listitem><para><code>/afs/hcoop.net/common/etc/scripts/hcoop-all-db-backup</code> </para></listitem></itemizedlist><para>To figure out: </para><itemizedlist><listitem><para>how we manage files on the rsync.net end </para></listitem></itemizedlist></section></article>