[OLUG] can we talk backups?
Vincent
vraffensberger at home.com
Sun Mar 19 07:23:11 UTC 2000
Just to get the subject fired up a little, here's a script I've made to
do back-ups. I pasted it as a quote in case word-wrap mangles it...).
I run rhis every night on two different machines and a copy of each is
stored on each and deletes the old ones. My bu-list contains /etc
/home/httpd /var/log and /home/name/\.* The tar file is typically 4MB.
It could probably use some work, but it's better than nothing.
> #!/bin/sh
>
> PC=`/bin/uname -n`
> BIN=/root/bin
> BLOC=/var/backup
> JDATE=`/bin/date +%Y%j`
> export PC BIN BLOC JDATE
> BUF=${BLOC}/${PC}.daily_backup.${JDATE}.tar.gz
> BLOG=${BLOC}/${PC}.daily_backup.${JDATE}.log
> LIST=${BIN}/bu-list
> OLD=`/usr/bin/expr $JDATE - 10`
> export BUF BLOG OLD
>
> /bin/echo "Starting Back-up ..be patient"
> /bin/date >> ${BLOG} 2>&1
> /bin/df -hal >> ${BLOG} 2>&1
> /bin/tar -czvf ${BUF} -T ${LIST} >> ${BLOG} 2>&1
> /bin/rm -f ${BLOC}/*.daily_backup.${OLD}.* >> ${BLOG} 2>&1
> /usr/bin/rcp ${BUF} mypc2:${BLOC}
> /bin/sleep 5
> /usr/bin/rsh mypc2 ls -lah ${BLOC} >> ${BLOG} 2>&1
> /bin/sleep 3
> /usr/bin/rsh mypc2 /bin/rm -f ${BLOC}/*.daily_backup.${OLD}.* >> ${BLOG} 2>&1
> /bin/sleep 3
> /usr/bin/rsh mypc2 df -hal >> ${BLOG} 2>&1
> /bin/sleep 3
> /usr/bin/rcp ${BLOG} mypc2:${BLOC}
> /bin/sleep 5
> /bin/df -hal >> ${BLOG} 2>&1
> /bin/date >> ${BLOG} 2>&1
> /bin/echo "Finished" >> ${BLOG} 2>&1
> /bin/echo "Finished"
Mike Hostetler wrote:
>
> I have a possible subject for a discussion. I am by no means qualified to do it, but
> I could help.
>
> The subject is backups. Things to consider:
>
> o how often (obviously, not often enough)?
> o which is better - tar or cpio?
> o best way to script it?
> o is it worth buying a commercial program for this (i.e. BRU)?
>
> This is a very sysadmin-ish subject, but is important to anyone that runs a system.
> I, myself, have had problems and had to reload Linux (usually due to hardware issues,
> not necessarily OS issues), and sometimes I have had recent backups and sometimes . .
> er, let's just say that I was hard to talk to for about four weeks.
>
> *If* no one jumps up and volunteers, I'll be brave enough to go up in front of the
> group and advertise my ignorance on the subject. But there has to be someone that has
> instutited better plans than what I have, which is:
>
> find /* -depth|grep -v var |grep -v proc|grep -v tmp > backup.txt
> cpio -o -H crc -F /dev/tape < backup.txt
>
> - mikeh
-------------------------------------------------------------------------
Sent by OLUG Mailing list Manager, run by ezmlm. http://olug.bstc.net/
To unsubscribe: `echo unsubsribe | mail olug-unsubscribe at bstc.net`
More information about the OLUG
mailing list