[BACK]Return to backup_config CVS log [TXT][DIR] Up to [local] / openbsd / backup_config

File: [local] / openbsd / backup_config / backup_config (download)

Revision 1.4, Thu May 21 22:05:06 2009 UTC (15 years, 1 month ago) by andrew
Branch: MAIN
Changes since 1.3: +1 -4 lines

actually run the tar.  oops

#!/bin/sh
# $RedRiver: backup_config,v 1.2 2009/05/21 21:54:34 andrew Exp $

FILE=`hostname -s`-`date +%Y-%m-%d`
local _maxhomesize=20480

local _list="/root \
  /etc \
  /var/backups \
  /var/www/conf"

local _mcfile=`grep '^### .*\.mc' /etc/mail/sendmail.cf | cut -d ' ' -f 2`
if [ X"${_mcfile}" != X"" ]; then
  _list="${_list} /usr/share/sendmail/cf/${_mcfile}"
fi

local _homesize=`du -ks /home/ | awk '{print $1}'`
if [ $_homesize -lt $_maxhomesize ]; then
	_list="${_list} /home/"
fi

tar czvf /tmp/${FILE}.tar.gz $_list