Misty Stanley-Jones wrote:
On Friday 03 June 2005 10:20 am, Josh Valmas wrote:
Bacula does auto file naming for me, so my retention period
(week-diff/month- full) will keep backup files around for ahwhile on the
disk, and then recycle them the next time through. I want to grab the most
recent volumes that bacula records to, and plop them on a disk. But
because it could be server-Full-001, or server-Full-001, etc., I don't know
how to tell the backup-to-tape fileset to grab the most recent volume, and
leave the rest alone because I have no desire to backup EVERYTHING to tape,
just the previous nights backup jobs.
Thanks in advance for any help/ideas you guys have to offer.
Josh V.
Here is what I did. This will have to work for me until the clone feature
makes it into a released version.
In the job def I have:
Run After Job = "/root/bacula_postexec.sh %v"
The %v gets expanded to the volume name.
Here is the shell script. It is simple and gets the job done. I could not
get bcopy to work. With this way you will have to restore the volume to the
disk before you can use it.
------------------------------------------------------
#!/bin/bash
# Take the volume name from the command line
disk_volume=$1
# Take the week number from a file (we have 3 weeks of tapes)
weeknum=`cat /root/weeknum`
# Take the day of the week for the tape label
day=`date -d yesterday +%a|tr '[A-Z]' '[a-z]'`
cd /etc/bacula
# Rewind the tape -- we will have every job in the volume and don't need more
mt rewind
# Write the volume to the tape with a label
tar cvf /dev/nst0 -V oink-$day-$weeknum /backup/$disk_volume
# This lets me know the copy finished
mt offline
# Increment the weeknum at the end of the week
if [ $weekday='sat' ]
then
let weeknum=$weeknum+1
if [ $weeknum > 3 ]
then
weeknum=1
fi
echo $weeknum > /root/weeknum
fi
Hi ,
I'm basically doing the same , but I copy my volumes to disk for offsite
usage. Now I am a bit fo a newbie when it comes to scripts , but this
script looks like exactly what I need to automate my offsite backups ,
however I will probably manually run the script everyday. If anyone has
the time / patience to guide me through this I would greatly appreciate
it. I run a full backup 1st Sun of every month with daily Incrementals
after that (hope this is an OK strategy?) , and I copy the latest (the
previous day's) volumes to the offsite disk.Basically what I do is to
create a dir wth the date , and then copy the volumes to their
respective dir on the offsite disk ex:
mkdir /offsite1/apollo/2005-06-06
cp -v --preserve=all /arch/apollo/apollousersincr-0010
/offsite1/apollo/2005-06-06
Thanks in advance!
D
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users