From: Damian O'H. <da...@co...> - 2005-02-24 23:56:20
|
Mark Montgomery's archiveme.pl script seems to work fine but I'd like to only copy the fulls to CDRW/Tape. As I don't know perl, here's a shell kludge to show what I'm trying to do .... #!/bin/sh hosttoarch="jola" lastbackup=`tail -1 /opt/backuppc/files/pc/$hosttoarch/backups | awk '{print $2}'` if [ $lastbackup = "incr" ] ; then echo "last was incr" exit 0 else echo "last was full" # Uncomment next 2 lines to write CD # mkisofs -R -o /tmp/cdimage.raw /opt/backuppc/files/pc/archive/$hosttoarch/* # cdrecord -v dev=0,0,0 speed=20 driveropts=burnfree /tmp/cdimage.raw # Uncomment next 2 lines to write to tape device # tar cvf /dev/rst0 /opt/backuppc/files/pc/archive/$hosttoarch/* # rm /opt/backuppc/files/pc/archive/$hosttoarch/* mail -s "Weekly archive created - please change CD/Tape" bac...@my... < /dev/null fi It could be tagged to start after Mark's script or called at the end of it. It doesn't cope with multiple CDs/DVDs/Tapes if required but you get the idea. Can anyone with an interest and some perl make any improvements on this ? If there's an easier way then I'm all ears :) Damian |