William McInnis wrote:
> ok i have a tape drive is there  a way to get all my backups say every friday 
> to a tape ?
> 

I use such a script - it retrieves the last full backup from BackupPC 
archive, and makes tar.gz packages out of it.
When the packages are done, you can write them to tape.


For some more info, I placed the script here: 
http://wpkg.org/index.php/BackupPC_-_restoring_backups_from_command_line


#!/bin/bash

# Script for restoring hosts (last full backup) from command line.
# The restored backups can be found in $RESTOREDIR (defined below),
# and are to be written on tape.

BACKUPPCDIR=/srv/backuppc-data
HOSTSDIR=$BACKUPPCDIR/pc
RESTOREDIR=$HOSTSDIR/restore/restore

# put the hosts/directories you don't want to restore into egrep...
HOSTS=$(ls $HOSTSDIR | egrep -v '(HOST_CONFIG_FILES|restore)' | tr / " ")
# or use:
# HOSTS="HOST1 HOST2 REMOTE3"

# just a spacer... '


# no need to change anything below...

DATE=$(date +%F)
mkdir -p $RESTOREDIR/$DATE

for HOST in $HOSTS
do
# find the last full backup
NUMBER=$(grep full $HOSTSDIR/$HOST/backups| tail -1 | cut -f1)

if [ "$NUMBER" ]
then

# do the backup for the host
$BACKUPPCDIR/bin/BackupPC_archiveHost 
$BACKUPPCDIR/bin/BackupPC_tarCreate /usr/bin/split /usr/bin/par2 \
             "$HOST" "$NUMBER" /usr/bin/gzip .gz 0000000 
$RESTOREDIR/$DATE 0 \*
fi

done


-- 
Tomasz Chmielewski

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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