Hi Tormod,

Well here's my crude attempt which works if you're only backing up one host. For more than one you'll need to hack it again:

#!/bin/sh
TODAY=`/bin/date +%Y-%m-%d_%H:%M`
admin="[EMAIL PROTECTED]"

# Check if backup just done was a full (only send fulls to tape)
lastbackup=`/bin/grep started /opt/backuppc/files/pc/server1/LOG | /usr/bin/tail
-1 | awk '{print $3}'`
       if [ $lastbackup = "incr" ] ; then
               echo "last was incr"
               exit 0
       else
               echo "last was full"

# Check tape is in drive
TAPE=`/bin/mt -f /dev/st0 status | /bin/grep ONLINE`
#echo $?
       if [ "$?" = "1" ] ; then
/bin/mail -s "Tape archive failed - no tape detected in drive" $admin < /opt/backuppc/files/conf/no_tape_message.txt
               exit 0
       fi

# Delete old image and create new one
       rm /tmp/Burn/*
/usr/share/backuppc/bin/BackupPC_tarCreate -h server1 -n -1 -s / / | /bin/gzip -3 > /tmp/Burn/Server1-$TODAY.tar.gz

# Check image size is less than 20GB (tape size) - not working yet
#IMGSIZE=`ls -l /tmp/Burn/Server1-$TODAY.tar.gz | awk '{print $5}'`
#imgsize=`ls -l /tmp/Burn/Serv* | awk '{print $5}'`
#tapesize=19500000000              # 20GB Travan Tape
#               echo "Tape size is $tapesize and Image size is $imgsize"
#       if [ $imgsize -gt $tapesize ] ; then
# /bin/mail -s "Tape archive failed - not enough tape space for image" $admin < /dev/null
#               exit 0
#       fi
# Copy image to tape and eject tape
               /bin/tar cf /dev/st0 /tmp/Burn/*
               /bin/mt -f /dev/st0 rewoffl
/bin/mail -s "Tape archive created - please change the Tape" $admin < /dev/null
       fi
=======================================
And to go with it, here's a sample no_tape_message.txt file:


The full backup archive to tape could not be completed because no tape was detected in the tape drive. Please load a blank tape into the drive and run the following script as the user backuppc:

/opt/backuppc/files/conf/cwpfulltapearchive.sh

Thankyou

=======================================

At least it's somewhere to start. There must be loads of people with better scripts. Anyone want to post them ?

Damian

Damian O'Hara wrote:

Hi Tormod,
You could add a post-backup script to do it. I created a very rough script which
runs an archive to tape straight after a full backup completes. It ignores
incrementals.
I'll post it when I get home and you could hack it around.
Damian

Quoting Tormod Omholt-Jensen <[EMAIL PROTECTED]>:

I would like to set ut backuppc to automatically dump an archive of the
latest backup, once a day. I can not find anything about this in the
documentation.

Doesn't backuppc support this?

I considered setting up a cron-job invoking the BackupPC_archiveHost
script, but I cannot find any description on the parameters to use.


Anyone having ideas on how to solve this?


--
Tormod Omholt-Jensen
Developer
Boost Communications AS
http://www.boostcom.no


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/






-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Reply via email to