Index: trunk/packages/xvm-db-backup/debian/changelog
===================================================================
--- trunk/packages/xvm-db-backup/debian/changelog	(revision 1656)
+++ trunk/packages/xvm-db-backup/debian/changelog	(revision 1656)
@@ -0,0 +1,5 @@
+xvm-db-backup (0.0.1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Evan Broder <broder@mit.edu>  Sat, 15 Nov 2008 11:34:36 -0500
Index: trunk/packages/xvm-db-backup/debian/compat
===================================================================
--- trunk/packages/xvm-db-backup/debian/compat	(revision 1656)
+++ trunk/packages/xvm-db-backup/debian/compat	(revision 1656)
@@ -0,0 +1,1 @@
+5
Index: trunk/packages/xvm-db-backup/debian/control
===================================================================
--- trunk/packages/xvm-db-backup/debian/control	(revision 1656)
+++ trunk/packages/xvm-db-backup/debian/control	(revision 1656)
@@ -0,0 +1,14 @@
+Source: xvm-db-backup
+Section: servers
+Priority: extra
+Maintainer: SIPB XVM Project <xvm@mit.edu>
+Build-Depends: cdbs, debhelper (>= 5)
+Standards-Version: 3.8.0
+
+Package: xvm-db-backup
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ debathena-kerberos-config, debathena-afs-config,
+ openafs-client, postgresql-client-common
+Description: Configure the database backup on XVM servers
+ Backup the XVM database to AFS hourly
Index: trunk/packages/xvm-db-backup/debian/copyright
===================================================================
--- trunk/packages/xvm-db-backup/debian/copyright	(revision 1656)
+++ trunk/packages/xvm-db-backup/debian/copyright	(revision 1656)
@@ -0,0 +1,17 @@
+This software was written for the XVM project <xvm@mit.edu>
+of the MIT Student Information Processing Board.
+
+Copyright :
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+On Debian systems, the complete text of the GNU General Public License
+can be found in the file /usr/share/common-licenses/GPL.
Index: trunk/packages/xvm-db-backup/debian/rules
===================================================================
--- trunk/packages/xvm-db-backup/debian/rules	(revision 1656)
+++ trunk/packages/xvm-db-backup/debian/rules	(revision 1656)
@@ -0,0 +1,3 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
Index: trunk/packages/xvm-db-backup/debian/xvm-db-backup.cron.hourly
===================================================================
--- trunk/packages/xvm-db-backup/debian/xvm-db-backup.cron.hourly	(revision 1656)
+++ trunk/packages/xvm-db-backup/debian/xvm-db-backup.cron.hourly	(revision 1656)
@@ -0,0 +1,3 @@
+#!/usr/bin/pagsh
+
+exec /usr/sbin/xvm-db-backup
Index: trunk/packages/xvm-db-backup/debian/xvm-db-backup.install
===================================================================
--- trunk/packages/xvm-db-backup/debian/xvm-db-backup.install	(revision 1656)
+++ trunk/packages/xvm-db-backup/debian/xvm-db-backup.install	(revision 1656)
@@ -0,0 +1,1 @@
+xvm-db-backup usr/sbin
Index: trunk/packages/xvm-db-backup/xvm-db-backup
===================================================================
--- trunk/packages/xvm-db-backup/xvm-db-backup	(revision 1656)
+++ trunk/packages/xvm-db-backup/xvm-db-backup	(revision 1656)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+set -e
+
+kinit -k "daemon/$(hostname -f)"
+aklog sipb
+
+filename="$(date +%Y-%m-%d-%H-%M.sql.gz)"
+
+/usr/bin/pg_dump -U "$(invirt-getconf db.user)" \
+                 -h "$(invirt-getconf db.host)" \
+                 "$(invirt-getconf db.dbname)" | gzip - >"$filename"
