| | #!/bin/sh |
---|
| | # tconfigfiles - Manage Configuration Files |
---|
| | # Copyright (c) 2007-2013 TundraWare Inc., Des Plaines, IL USA |
---|
| | # All Rights Reserved |
---|
| | # $Id: tconfigfiles,v 1.117 2013/02/13 14:55:42 tundra Exp $ |
---|
| | # $Id: tconfigfiles,v 1.118 2013/02/13 15:33:42 tundra Exp $ |
---|
| | |
---|
| | # Where things live |
---|
| | |
---|
| | CFBASE=${CFBASE:-$HOME/configfiles} # The directory that holds everything below |
---|
| | # Can be overridden with $CFBASE env var |
---|
| | CFREPO=${CFREPO:-$HOME/configfiles} # The directory that holds everything below |
---|
| | # Can be overridden with $CFREPO env var |
---|
| | |
---|
| | ARCHIVES=archives # Where archives go |
---|
| | FILES=tree # Where tree of individual files lives |
---|
| | |
---|
| | ARCHIVEDIR="$CFBASE/$ARCHIVES" |
---|
| | FILEDIR="$CFBASE/$FILES" |
---|
| | ARCHIVEDIR="$CFREPO/$ARCHIVES" |
---|
| | FILEDIR="$CFREPO/$FILES" |
---|
| | |
---|
| | # Make sure the container directories exist |
---|
| | |
---|
| | mkdir -p $ARCHIVEDIR |
---|
| |
---|
| | |
---|
| | |
---|
| | "cfarchive") # Make archival copy of current tree |
---|
| | timestamp=`date "+%Y-%m-%d-%H%M%S"` |
---|
| | cd $CFBASE |
---|
| | cd $CFREPO |
---|
| | MACHNAME=`hostname -f` |
---|
| | archdir=$MACHNAME-$FILES-$timestamp |
---|
| | cp -pvR $FILES $archdir |
---|
| | tar -czvf $ARCHIVES/$archdir.tar.gz $archdir |
---|
| |
---|
| | |