[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.3, Thu May 21 22:03:05 2009 UTC (15 years, 1 month ago) by andrew
Branch: MAIN
Changes since 1.2: +18 -7 lines

backup /home if it is less than 20M, only backup the .mc file if we can find it

#!/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

echo $_list

#  /home \
#tar czvf /tmp/${FILE}.tar.gz $_list