Return to backup_config CVS log | Up to [local] / openbsd / backup_config |
File: [local] / openbsd / backup_config / backup_config (download)
Revision 1.6, Thu May 21 22:41:08 2009 UTC (15 years, 1 month ago) by andrew
say things that are more useful, not things that are too verbose |
#!/bin/sh # $RedRiver: backup_config,v 1.5 2009/05/21 22:25:39 andrew Exp $ if [ `id -u` -ne 0 ]; then echo You should run this as root! >&2 exit 255 fi 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/" else echo Not backing up /home, too large! fi tar czf /tmp/${FILE}.tar.gz $_list echo backed up $_list echo "\tto /etc/$FILE"