Package: obnam
Version: 1.6.1-1
Severity: wishlist

I wish to have an example script for "obnam mount" shipped in
/usr/share/doc/obnam/examples to help users :-)

Considering this may be used for current and old obnam repositories, I
thought attached may be an good example script.

So far, it works for me.

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.11-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages obnam depends on:
ii  libc6             2.17-97
ii  python            2.7.5-5
ii  python-cliapp     1.20130808-1
ii  python-fuse       2:0.2.1-8
ii  python-larch      1.20131130-1
ii  python-paramiko   1.10.1-1
ii  python-tracing    0.6-2
ii  python-ttystatus  0.23-1

obnam recommends no packages.

obnam suggests no packages.

-- no debconf information
#!/bin/sh
# 
# script to mount all historical obnam repository data
#
# Syntax:
#     obnam-mount [path/to/obnam-repo [/base/path]]
#
# path/to/obnam-repo : default "." ; where the obnam backup exists
# /base/path         : default "/" ; skip this path when mounting
#
# Public domain: 2013-12-09 Osamu Aoki
#
DIR=${1:-.}
ROOT=${2:-/}

if ! dpkg -l python-fuse >/dev/null ; then
  echo "Error: package \"python-fuse\" is missing.  Please install." >&2
  exit 1
fi
if [ ! -f $DIR/chunklist/metadata  -o ! -f $DIR/chunksums/metadata -o \
     ! -f $DIR/clientlist/metadata  -o ! -f $DIR/metadata/format -o \
     ! -d $DIR/chunks ]; then
  echo "Error: Path \"$DIR\" is not a obnam repository." >&2
  echo >&2
  echo "Usage syntax:">&2
  echo "        ${0##*/}  [path/to/obnam-repo [/base/path]]" >&2
  exit 1
fi

echo "... found the obnam backup repository at: \"$DIR\"" >&2
echo >&2

if [ -d $DIR/mount -a -f $DIR/mount/.pid ]; then
  echo "... updating the history data at: \"$DIR/mount\"" >&2
  kill -HUP `cat $DIR/mount/.pid`
  echo >&2
else
  mkdir -p $DIR/mount
  echo "... creating the history data at: \"$DIR/mount\"" >&2
  echo >&2
fi
obnam mount  $ROOT --repository=$DIR --to=$DIR/mount \
               --viewmode=multiple --log=$DIR/mount.log
echo "ls -lt $DIR/mount"
ls -lt $DIR/mount

Reply via email to