PDA

View Full Version : Archive to Tape



March 31st, 2009, 11:00 PM
Is it possible to Archive data to Tape - say once a week.

(I'm if possible without using a seperate box)

If not is there a way to do a "Automated" via a Zip(filenane based on datetime ) archive to a Share??

undertree
October 21st, 2009, 05:58 AM
I use this bash script for creating archives automatically. It grabs the last latest backup created. DATADIR is the place you want the archives sent to. BackupPCDATADIR is where you Data Dir for Backuppc is. BackupPCBIN is the bin dir for Backuppc. Change the pbzip2 compression at the end to whatever you want to use if pbzip2 is not available (ex. gzip, bzip2).

Brian

######################################
# BackupPC Archive Script
# Brian Smith - Bonnier Corporation
######################################
#!/bin/bash

DATADIR=/mnt/Buffalo/BackupPC/weekly-dumps
BackupPCDATADIR=/opt/BackupPC/data/pc
BackupPCBIN=/opt/BackupPC/bin

# Uncomment to remove old backups
#echo "Removing old backups....."
#find $DATADIR/ -type f | while read foo; do
# rm -fv $foo
#done

echo "Checking dump directories....."
ls $BackupPCDATADIR | grep -v archive | while read foo; do
mkdir $DATADIR/$foo 2>/dev/null
chmod 777 $DATADIR/$foo 2>/dev/null
done

ls $BackupPCDATADIR | grep -v archive | while read host; do
echo Dumping $host `date`........
$BackupPCBIN/BackupPC_tarCreate -t -h $host -n -1 -s \* . > $DATADIR/$host/$host.`date +%Y%m%W`.tar
pbzip2 -p7 $DATADIR/$host/$host.`date +%Y%m%W`.tar
echo Done! `date`
done
exit 0

undertree
March 28th, 2011, 06:19 AM
Just setup the script to run in cron, and set the datadir to you tape device. You would probably remove the pbzip line.