=================================================================== RCS file: /cvs/openbsd/backup_config/backup_config,v retrieving revision 1.3 retrieving revision 1.6 diff -u -r1.3 -r1.6 --- openbsd/backup_config/backup_config 2009/05/21 23:03:05 1.3 +++ openbsd/backup_config/backup_config 2009/05/21 23:41:08 1.6 @@ -1,6 +1,11 @@ #!/bin/sh -# $RedRiver: backup_config,v 1.2 2009/05/21 21:54:34 andrew Exp $ +# $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 @@ -17,9 +22,11 @@ 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 -echo $_list +tar czf /tmp/${FILE}.tar.gz $_list -# /home \ -#tar czvf /tmp/${FILE}.tar.gz $_list +echo backed up $_list +echo "\tto /etc/$FILE"