-etc-obnam.debhelper.log
-etc-obnam.postrm.debhelper
-etc-obnam.substvars
-etc-obnam/
+etc-bup.debhelper.log
+etc-bup.postrm.debhelper
+etc-bup.substvars
+etc-bup/
files
+debhelper-build-stamp
+
-etc-obnam for Debian
+etc-bup for Debian
--------------------
<possible notes regarding this package - if none, delete this file>
+etc-bup (0.10.1) unstable; urgency=medium
+
+ * Minor fixes
+
+ -- Andrew Ruthven <puck@etc.gen.nz> Thu, 12 Oct 2017 00:15:03 +1300
+
+etc-bup (0.10) unstable; urgency=medium
+
+ * Rename from etc-obnam as now I'm using bup for my backups.
+
+ -- Andrew Ruthven <andrew@etc.gen.nz> Sun, 08 Oct 2017 10:27:13 +1300
+
etc-obnam (0.9) unstable; urgency=low
* Sigh. We need to use egrep to use a regex in grep.
-/etc/obnam/id_rsa
-/etc/obnam/id_rsa.pub
-/etc/obnam/etc-obnam.conf
+/etc/etc-bup/id_rsa
+/etc/etc-bup/id_rsa.pub
#!/bin/sh
set -e
-PACKAGE=etc-obnam
+PACKAGE=etc-bup
CONFIGFILE=/etc/default/$PACKAGE
. /usr/share/debconf/confmodule
-Source: etc-obnam
+Source: etc-bup
Section: optional
Priority: extra
Maintainer: Andrew Ruthven <andrew@etc.gen.nz>
Vcs-Git: git://git.etc.gen.nz/etc-obnam.git
Vcs-Browser: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?p=etc-obnam.git;a=summary
-Package: etc-obnam
+Package: etc-bup
Architecture: all
Depends: ${misc:Depends}, debconf-utils, bind9-host, procmail
-Recommends: obnam, molly-guard
-Description: Wrapper around obnam for backing up laptops and PCs
- Runs obnam on a schedule, but only if we're on the right network.
+Recommends: bup, molly-guard
+Description: Wrapper around bup for backing up laptops and PCs
+ Runs bup on a schedule, but only if we're on the right network.
-/var/lib/etc-obnam
-/etc/obnam
+/var/lib/etc-bup
+/etc/etc-bup
-obnam.list /etc/apt/sources.list.d/
-run-backup /usr/lib/etc-obnam/
-molly-guard/45-obnam /etc/molly-guard/run.d
+run-backup /usr/lib/etc-bup/
+molly-guard/45-bup /etc/molly-guard/run.d
-/var/log/obnam.log
+/var/log/bup.log
{
weekly
missingok
#!/bin/sh
-# postinst script for etc-obnam
+# postinst script for etc-bup
#
# see: dh_installdeb(1)
set -e
[ -n "${DEBUG}" ] && set -o xtrace
-PACKAGE=etc-obnam
+PACKAGE=etc-bup
[ -n "${DEBUG}" ] && echo "PostInst Parameters: $@" 1>&2
if [ -e /usr/share/debconf/confmodule ]; then
fi
generate_crontab() {
- echo "# Crontab to run the obnam backup on a regular schedule"
+ echo "# Crontab to run the bup backup on a regular schedule"
echo "#"
echo "# * * * AUTOMATICALLY MAINTAINED - DO NOT EDIT * * *"
echo "#"
echo "# If this is unset, then just being able to ping the above host is sufficient.)"
echo "HOST_MAC='$HOST_MAC'"
echo ""
+ echo "# Repository we're backing up to"
+ echo "REPOSITORY='$REPOSITORY'"
+ echo ""
echo "# Which directories do we backup to?"
echo "SOURCE='$SOURCE'"
}
generate_ssh_key() {
- ssh-keygen -q -t rsa -C "obnam@$(hostname) - $(date +%F)" -N "" -f /etc/obnam/id_rsa
+ ssh-keygen -q -t rsa -C "bup@$(hostname) - $(date +%F)" -N "" -f /etc/bup/id_rsa
}
-generate_obnam_config() {
- echo "# Configuration file for obnam."
- echo "#"
- echo "# This file is generated automatically. You can override these settings by"
- echo "# creating a file which is sorted alphabetically after this one and inserting"
- echo "# the updated settings in that file."
- echo "#"
- echo "[config]"
- echo "log = /var/log/obnam.log"
- echo "ssh-key = /etc/obnam/id_rsa"
- echo "log-level = info"
- echo "lock-timeout = 600"
- echo "#"
- echo "# To reconfigure the following settings run:"
- echo "# dpkg-reconfigure $PACKAGE"
- echo "repository = $REPOSITORY"
- echo "exclude = $EXCLUDE"
+generate_ssh_config() {
+ echo "Host $HOST_NAME"
+ echo " User $BUP_USER"
+ echo " IdentityFile /etc/${PACKAGE}/id_rsa"
}
case "$1" in
configure|reconfigure)
DEBIANCONFIG="/etc/default/$PACKAGE"
- OBNAMCONFIG="/etc/obnam/${PACKAGE}.conf"
CRONTAB="/etc/cron.d/${PACKAGE}"
+ SSHCONFIG="/etc/${PACKAGE}/ssh_config"
+
+ # To allow migration from etc-obnam, if no etc-bup config file eixsts,
+ # but etc-obnam config exists, we load that.
+ [ ! -f $DEBIANCONFIG -a -f /etc/default/etc-obnam ] && . /etc/default/etc-obnam
# Load current settings, most of which will be overwritten.
[ -f $DEBIANCONFIG ] && . $DEBIANCONFIG
db_get ${PACKAGE}/host_mac || true
HOST_MAC="${RET}"
+ db_get ${PACKAGE}/user || true
+ BUP_USER="${RET}"
+
db_get ${PACKAGE}/source
SOURCE="${RET}"
generate_crontab > $CRONTAB
generate_debian_config > $DEBIANCONFIG
- generate_obnam_config > $OBNAMCONFIG
+ generate_ssh_config > $SSHCONFIG
+ echo $EXCLUDE | perl -nlpe "s/, /\n/g" > /etc/$PACKAGE/exclude.list
+
+ if ! grep -q $SSHCONFIG /root/.ssh/config; then
+ [ -d /root/.ssh/config ] || mkdir -p /root/.ssh
+ echo -e "\n\nInclude $SSHCONFIG" >> /root/.ssh/config
+ fi
- if [ ! -f /etc/obnam/id_rsa ]; then
- generate_ssh_key
+ if [ ! -f /etc/$PACKAGEid_rsa ]; then
+ if [ -f /etc/obnam/id_rsa ]; then
+ cp /etc/obnam/id_rsa* /etc/$PACKAGE
+ else
+ generate_ssh_key
- echo New ssh key generated for this host, please add it to the backup host.
+ echo New ssh key generated for this host, please add it to the backup host.
+ fi
fi
;;
-Template: etc-obnam/repository
+Template: etc-bup/repository
Type: string
-Default: sftp://backups@backup/private/obnam/backups/
-Description: URL for where to backup to, including the destination path.
- An obnam supported URL for where to backup to.
+Default: /private/bup/backups/
+Description: Path of where we should backup
+ A bup supported path for where to backup to. If using a remote server,
+ exclude the server name.
-Template: etc-obnam/host_name
+Template: etc-bup/host_name
Type: string
Default: backup
Description: The server to backup to
The server that we're to submit our backups to. Can be a hostname or an IP
address.
-Template: etc-obnam/host_mac
+Template: etc-bup/host_mac
Type: string
-Default: 00:1a:4d:9e:2d:11
+Default: 70:71:bc:a8:1f:a1
Description: MAC address of the server we're backing up to.
The MAC address that we're submitting our backups to. Used to determine
if the configured hostname is accessible on the local network.
-Template: etc-obnam/scheduled_time
+Template: etc-bup/user
+Type: string
+Default: backups
+Description: Name of the user on the remote server to connect to.
+ Who do we connect as?
+
+Template: etc-bup/scheduled_time
Type: string
Default: 10 * * * *
Description: Adjust the cron schedule for running the backup.
-Template: etc-obnam/source
+Template: etc-bup/source
Type: string
Default: /home /etc /var/spool/cron/crontabs
Description: Directories to be included in the backup.
A space separated list of the directories to be backed up.
-Template: etc-obnam/exclude
+Template: etc-bup/exclude
Type: string
Default: \.xchat2, .*/\.cache/.*, \.thumbnails/.*, \.mozilla/firefox/.*\.default/Cache, \.local/share/Trash, /home/andrew/data/reference, /home/.*/scratch, .xbmc/temp, /home/.*/Network/.*, .*/[Cc]ache/.*, \.evolution/mail/imap
Description: List of regexes to be excluded from the backup.
ME=molly-guard
-COUNT=$(ps ax | grep obnam | egrep -v "(grep|$0)" | wc -l)
+COUNT=$(ps ax | grep bup | egrep -v "(grep|$0)" | wc -l)
if [ $COUNT -eq 0 ]; then
- echo "I: I can't find any running obnam backups, skipping check" >&2
+ echo "I: I can't find any running bup backups, skipping check" >&2
exit 0;
fi
trap 'echo;sigh' 1 2 3 9 10 12 15
-echo -n "Obnam is running a backup. Type YES to $MOLLYGUARD_CMD: "
+echo -n "bup is running a backup. Type YES to $MOLLYGUARD_CMD: "
read CONFIRM || :
[ $(echo "x$CONFIRM" | tr 'A-Z' 'a-z') = "xyes" ] || sigh
+++ /dev/null
-deb http://code.liw.fi/debian squeeze main
#!/bin/bash
-# Conditionally run obnam.
+# Conditionally run bup.
#
# If $HOST_NAME is defined, check that we can ping it.
# If $HOST_MAC is defined, check that the arp/neighbour table has a matching
# If those conditions are meet, then backup $SOURCE, but first grab some
# debconf data so we can reconstruct the packages installed if we need to.
-. /etc/default/etc-obnam
+. /etc/default/etc-bup
CLIENT=$(hostname)
SOURCE=${SOURCE:-/home /etc}
-WORKDIR=/var/lib/etc-obnam
+WORKDIR=/var/lib/etc-bup
# Check that the host is local, support both IPv4 and IPv6.
check_host() {
fi
# ping or ping6?
- local cmd=ping
+ local cmd=ping4
if [ $type = "AAAA" ]
then
cmd=ping6
then
capture_debconf_info
- if ! lockfile -r20 /var/lock/etc-obnam
+ if ! lockfile -r20 /var/lock/etc-bup
then
echo Failed to obtain local lock
exit
fi
+ # If this is the first time we're running, init ourselves.
+ if [ ! -d /root/.bup ]; then
+ bup init -r $HOST_NAME:$REPOSITORY
+ fi
+
# We try to impact on the user as much as possible, so nice
# ourselves completely.
- ionice -c idle nice obnam --quiet --client-name=$CLIENT backup $WORKDIR $SOURCE
+ ionice -c idle nice bup index --exclude-rx-from /etc/etc-bup/exclude.list $SOURCE $WORKDIR
+ ionice -c idle nice bup save -r $HOST_NAME:$REPOSITORY -n $CLIENT $SOURCE $WORKDIR
- rm /var/lock/etc-obnam
+ rm /var/lock/etc-bup
exit 0
else
echo huh, where is it?