Re: [Bacula-users] How would I 'nuke' my bacula instance - Start afresh so to speak.

2011-01-05 Thread Graham Keeling
On Wed, Jan 05, 2011 at 09:38:14AM +, Mister IT Guru wrote:
 I've run lots of test jobs, and I have a lot of backup data, that I 
 don't really need, around 2TB or so! (we have a few servers!) I would 
 like to know if it's possible to remove all of those jobs out of the 
 bacula database. Personally, I would have cut this configure out, and 
 drop it on a previous backup I have, but then I don't learn about how 
 bacula works.
 
 My main fear, is that I rsync my disk backend offsite, and I've 
 currently suspended that because of all these test jobs that I'm 
 running. Also, I've reset the bacula-dir and sd, during backups, and 
 I've a feeling that some of them are not viable.
 
 I guess what I'm asking is, is it possible to wipe the slate clean, but 
 keep my working configuration from within bacula?

It sounds like you just want to wipe your sql database and keep your bacula
configuration files.

When I want to do this, I stop bacula and stop mysql (I use mysql):

/etc/rc.d/init.d/bacula stop
/etc/rc.d/init.d/mysql stop

I then 'rm -r' the bacula mysql database files - something like this:

cd /var/lib/mysql/data
rm -r bacula

I then start mysql and start bacula:

/etc/rc.d/init.d/mysql start
/etc/rc.d/init.d/bacula start


--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] How would I 'nuke' my bacula instance - Start afresh so to speak.

2011-01-05 Thread Mister IT Guru
On 05/01/2011 09:51, Graham Keeling wrote:
 On Wed, Jan 05, 2011 at 09:38:14AM +, Mister IT Guru wrote:
 I've run lots of test jobs, and I have a lot of backup data, that I
 don't really need, around 2TB or so! (we have a few servers!) I would
 like to know if it's possible to remove all of those jobs out of the
 bacula database. Personally, I would have cut this configure out, and
 drop it on a previous backup I have, but then I don't learn about how
 bacula works.

 My main fear, is that I rsync my disk backend offsite, and I've
 currently suspended that because of all these test jobs that I'm
 running. Also, I've reset the bacula-dir and sd, during backups, and
 I've a feeling that some of them are not viable.

 I guess what I'm asking is, is it possible to wipe the slate clean, but
 keep my working configuration from within bacula?
 It sounds like you just want to wipe your sql database and keep your bacula
 configuration files.

 When I want to do this, I stop bacula and stop mysql (I use mysql):

 /etc/rc.d/init.d/bacula stop
 /etc/rc.d/init.d/mysql stop

 I then 'rm -r' the bacula mysql database files - something like this:

 cd /var/lib/mysql/data
 rm -r bacula

 I then start mysql and start bacula:

 /etc/rc.d/init.d/mysql start
 /etc/rc.d/init.d/bacula start

This would mean I would manually deleted my disk based backups? 
Otherwise if I don't then wouldn't the first attempt to run a backup 
fail, because that disk volume exists? DiskBackupPool-001 as a file 
already exists, so will bacula just overwrite it?

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] How would I 'nuke' my bacula instance - Start afresh so to speak.

2011-01-05 Thread Graham Keeling
On Wed, Jan 05, 2011 at 09:55:17AM +, Mister IT Guru wrote:
 On 05/01/2011 09:51, Graham Keeling wrote:
  On Wed, Jan 05, 2011 at 09:38:14AM +, Mister IT Guru wrote:
  I've run lots of test jobs, and I have a lot of backup data, that I
  don't really need, around 2TB or so! (we have a few servers!) I would
  like to know if it's possible to remove all of those jobs out of the
  bacula database. Personally, I would have cut this configure out, and
  drop it on a previous backup I have, but then I don't learn about how
  bacula works.
 
  My main fear, is that I rsync my disk backend offsite, and I've
  currently suspended that because of all these test jobs that I'm
  running. Also, I've reset the bacula-dir and sd, during backups, and
  I've a feeling that some of them are not viable.
 
  I guess what I'm asking is, is it possible to wipe the slate clean, but
  keep my working configuration from within bacula?
  It sounds like you just want to wipe your sql database and keep your bacula
  configuration files.
 
  When I want to do this, I stop bacula and stop mysql (I use mysql):
 
  /etc/rc.d/init.d/bacula stop
  /etc/rc.d/init.d/mysql stop
 
  I then 'rm -r' the bacula mysql database files - something like this:
 
  cd /var/lib/mysql/data
  rm -r bacula
 
  I then start mysql and start bacula:
 
  /etc/rc.d/init.d/mysql start
  /etc/rc.d/init.d/bacula start
 
 This would mean I would manually deleted my disk based backups? 
 Otherwise if I don't then wouldn't the first attempt to run a backup 
 fail, because that disk volume exists? DiskBackupPool-001 as a file 
 already exists, so will bacula just overwrite it?

Sorry, I don't know what bacula will do if the actual volume already exists.

But, yes, if I wanted to start fresh but keep the same configuration, I would
wipe the database as already described, and delete the actual volumes manually.


--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] How would I 'nuke' my bacula instance - Start afresh so to speak.

2011-01-05 Thread Jan Lentfer
On Wed, 05 Jan 2011 09:38:14 +, Mister IT Guru misteritg...@gmx.com
wrote:
 I've run lots of test jobs, and I have a lot of backup data, that I 
 don't really need, around 2TB or so! (we have a few servers!) I would 
 like to know if it's possible to remove all of those jobs out of the 
 bacula database. Personally, I would have cut this configure out, and 
 drop it on a previous backup I have, but then I don't learn about how 
 bacula works.
 
 My main fear, is that I rsync my disk backend offsite, and I've 
 currently suspended that because of all these test jobs that I'm 
 running. Also, I've reset the bacula-dir and sd, during backups, and 
 I've a feeling that some of them are not viable.
 
 I guess what I'm asking is, is it possible to wipe the slate clean, but 
 keep my working configuration from within bacula?

For each database type there is a description in the manual how to wipe
the database clean after initial setup and testing, e.g.

http://www.bacula.org/5.0.x-manuals/en/main/main/Installing_Configuring_Post.html#SECTION00433

hth

Jan

-- 
professional: http://www.oscar-consult.de
private: http://neslonek.homeunix.org/drupal/

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] How would I 'nuke' my bacula instance - Start afresh so to speak.

2011-01-05 Thread Paulo Martinez
Am 05.01.2011 um 10:38 schrieb Mister IT Guru:
 I've run lots of test jobs, and I have a lot of backup data, that I
 don't really need, around 2TB or so! (we have a few servers!) I would
 like to know if it's possible to remove all of those jobs out of the
 bacula database. Personally, I would have cut this configure out, and
 drop it on a previous backup I have, but then I don't learn about how
 bacula works.

 My main fear, is that I rsync my disk backend offsite, and I've
 currently suspended that because of all these test jobs that I'm
 running. Also, I've reset the bacula-dir and sd, during backups, and
 I've a feeling that some of them are not viable.

 I guess what I'm asking is, is it possible to wipe the slate clean,  
 but
 keep my working configuration from within bacula?




/etc/init.d/bacula-dir stop
/etc/init.d/bacula-sd stop
/etc/init.d/bacula-fd stop

/usr/libexec/bacula/drop_bacula_tables
/usr/libexec/bacula/make_mysql_tables

STR=$(cat /etc/bacula/bacula-sd.conf | grep Archive Device |grep -v  
dev |cut -d= -f2 | grep -v tmp | tr -d  )
  if [ -d $STR ];then
   echo Removing $STR ...
   rm $STR/*
  fi

rm /var/spool/bacula/*

/etc/init.d/bacula-dir start
/etc/init.d/bacula-sd start
/etc/init.d/bacula-fd start

maybe (for sure) some path are different on you system

--
PM



--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] How would I 'nuke' my bacula instance - Start afresh so to speak.

2011-01-05 Thread Jeremy Maes
Op 5/01/2011 10:55, Mister IT Guru schreef:
 On 05/01/2011 09:51, Graham Keeling wrote:
 On Wed, Jan 05, 2011 at 09:38:14AM +, Mister IT Guru wrote:
 I've run lots of test jobs, and I have a lot of backup data, that I
 don't really need, around 2TB or so! (we have a few servers!) I would
 like to know if it's possible to remove all of those jobs out of the
 bacula database. Personally, I would have cut this configure out, and
 drop it on a previous backup I have, but then I don't learn about how
 bacula works.

 My main fear, is that I rsync my disk backend offsite, and I've
 currently suspended that because of all these test jobs that I'm
 running. Also, I've reset the bacula-dir and sd, during backups, and
 I've a feeling that some of them are not viable.

 I guess what I'm asking is, is it possible to wipe the slate clean, but
 keep my working configuration from within bacula?
 It sounds like you just want to wipe your sql database and keep your bacula
 configuration files.

 When I want to do this, I stop bacula and stop mysql (I use mysql):

 /etc/rc.d/init.d/bacula stop
 /etc/rc.d/init.d/mysql stop

 I then 'rm -r' the bacula mysql database files - something like this:

 cd /var/lib/mysql/data
 rm -r bacula

 I then start mysql and start bacula:

 /etc/rc.d/init.d/mysql start
 /etc/rc.d/init.d/bacula start

 This would mean I would manually deleted my disk based backups?
 Otherwise if I don't then wouldn't the first attempt to run a backup
 fail, because that disk volume exists? DiskBackupPool-001 as a file
 already exists, so will bacula just overwrite it?


Or you could do this, as the bacula manual describes:
Section 41.3 Re-initializing the Catalog Database

After you have done some initial testing with Bacula, you will probably 
want to re-initialize the catalog
database and throw away all the test Jobs that you ran. To do so, you 
can do the following:

cd install-directory
./drop_mysql_tables
./make_mysql_tables

Please note that all information in the database will be lost and you 
will be starting from scratch. If you
have written on any Volumes, you must write an end of file mark on the 
volume so that Bacula can reuse it.

Do so with:
(stop Bacula or unmount the drive)
mt -f /dev/nst0 rewind
mt -f /dev/nst0 weof

Where you should replace /dev/nst0 with the appropriate tape drive 
device name for your machine.

If you're writing to files on disk you can just delete the volumes 
without any issues after clearing the catalog.

Kind regards,
Jeremy

  DISCLAIMER 
http://www.schaubroeck.be/maildisclaimer.htm

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] How would I 'nuke' my bacula instance - Start afresh so to speak.

2011-01-05 Thread Mister IT Guru
On 05/01/2011 10:01, Jan Lentfer wrote:
 On Wed, 05 Jan 2011 09:38:14 +, Mister IT Gurumisteritg...@gmx.com
 wrote:
 I've run lots of test jobs, and I have a lot of backup data, that I
 don't really need, around 2TB or so! (we have a few servers!) I would
 like to know if it's possible to remove all of those jobs out of the
 bacula database. Personally, I would have cut this configure out, and
 drop it on a previous backup I have, but then I don't learn about how
 bacula works.

 My main fear, is that I rsync my disk backend offsite, and I've
 currently suspended that because of all these test jobs that I'm
 running. Also, I've reset the bacula-dir and sd, during backups, and
 I've a feeling that some of them are not viable.

 I guess what I'm asking is, is it possible to wipe the slate clean, but
 keep my working configuration from within bacula?
 For each database type there is a description in the manual how to wipe
 the database clean after initial setup and testing, e.g.

 http://www.bacula.org/5.0.x-manuals/en/main/main/Installing_Configuring_Post.html#SECTION00433

 hth
Thanks for the link, most useful! But I'm going to assume that all disk 
based volumes already have an EOF? I can understand having to mark 
tapes, so can I assume that the disk based volumes that are already in 
existence will just get reused?

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] How would I 'nuke' my bacula instance - Start afresh so to speak.

2011-01-05 Thread Jan Lentfer
On Wed, 05 Jan 2011 10:15:10 +, Mister IT Guru misteritg...@gmx.com
wrote:

 Thanks for the link, most useful! But I'm going to assume that all disk 
 based volumes already have an EOF? I can understand having to mark 
 tapes, so can I assume that the disk based volumes that are already in 
 existence will just get reused?

Just rm them an start fresh should be ok.

Jan

-- 
professional: http://www.oscar-consult.de
private: http://neslonek.homeunix.org/drupal/

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] How would I 'nuke' my bacula instance - Start afresh so to speak.

2011-01-05 Thread Phil Stracchino
On 01/05/11 04:51, Graham Keeling wrote:
 When I want to do this, I stop bacula and stop mysql (I use mysql):
 
 /etc/rc.d/init.d/bacula stop
 /etc/rc.d/init.d/mysql stop
 
 I then 'rm -r' the bacula mysql database files - something like this:
 
 cd /var/lib/mysql/data
 rm -r bacula
 
 I then start mysql and start bacula:
 
 /etc/rc.d/init.d/mysql start
 /etc/rc.d/init.d/bacula start

Well, you could do it that way, but it's a bit like taking your car
apart to get your groceries out of the trunk.

This is particularly a poor method since Bacula already provides tools
for the job.

$ .../bacula/etc/bacula stop
$ .../bacula/etc/drop-mysql-tables
$ .../bacula/etc/make-mysql-tables
$ .../bacula/etc/bacula start

Done.


-- 
  Phil Stracchino, CDK#2 DoD#299792458 ICBM: 43.5607, -71.355
  ala...@caerllewys.net   ala...@metrocast.net   p...@co.ordinate.org
 Renaissance Man, Unix ronin, Perl hacker, Free Stater
 It's not the years, it's the mileage.

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users