=================================================================== RCS file: /cvs/openbsd/backup_config/backup_config,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- openbsd/backup_config/backup_config 2009/05/21 22:54:34 1.2 +++ openbsd/backup_config/backup_config 2009/05/21 23:03:05 1.3 @@ -1,14 +1,25 @@ #!/bin/sh -# $RedRiver: backup_config,v 1.1 2007/05/04 20:56:34 andrew Exp $ +# $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 \ - /root \ - /etc \ - /usr/share/sendmail/cf/$_mcfile \ - /var/backups \ - /var/www/conf +#tar czvf /tmp/${FILE}.tar.gz $_list