source: tags/confman-1.5.1/export.sh @ 123

Revision 123, 1.1 KB checked in by ccowart, 5 years ago (diff)

Developed the pull mechanism for confman. It's ready to go into production!

  • Property svn:executable set to *
  • Property svn:keywords set to Id
Line 
1#! /bin/bash
2
3##
4# This script prepares an "export" of the confman repository for system
5# processes to be able to pull. It is intended to be prepared regularly
6# by a cron. It may be useful to modify this script to only prepare
7# the export if the repository's most recent commit post-dates the
8# tarball.
9#
10# Author:   Chris Cowart <ccowart@rescomp.berkeley.edu>
11#           4 December 2006
12#
13# $Id$
14##
15
16#. /usr/local/rescomp/lib/confmancommon.sh
17. $HOME/src/sysadmin/confman/confmancommon.sh
18
19# If we're in debug mode, we should log stderr messages to the logger
20# as well. Otherwise, we send them to the bit bucket.
21if $DEBUG ; then
22    exec 1>&2
23else
24    exec 1>/dev/null
25fi
26
27REPO_URI="file://$REPO_PATH"
28backup=`mktemp -t confman`
29
30echo "Backing up $CONF_EXPORT_FILE"
31cp $CONF_EXPORT_FILE $backup
32
33echo "Beginning export operation." >&2
34if ! conf_export $CONF_EXPORT_FILE ; then
35    echo "The export failed. Restoring $CONF_EXPORT_FILE from backup." >&2
36    mv $backup $CONF_EXPORT_FILE
37    echo "Exiting." >&2
38    exit 1
39fi
40echo "Export complete." >&2
41
42echo "Removing $backup"
43rm $backup
44
Note: See TracBrowser for help on using the repository browser.