Re: [Bacula-users] Help binding scsi address to tape library

2014-01-15 Thread Thomas Eriksson


On 01/15/2014 12:48 PM, Luis G. Alford G. wrote:
> Hi 
> 
> I have installed a bacula server and it works ok but when I reboot the
> server the tape drive change's it's  scsi address when I reboot the
> server it is via FC .  any idea what i can do to avoid this from happen 
> 

There are probably several ways to solve this, but one of them is to use
the /dev/tape/by-id/*  names instead of the /dev/nst0 naming.

>From my bacula-sd.conf:

Autochanger {
  Name = HP-ML4048
  Device = LTO4-Drive-1, LTO4-Drive-2
  Changer Command = "/opt/bacula/scripts/mtx-changer %c %o %S %a %d"
  Changer Device = /dev/tape/by-id/scsi-3500110a0008dde58
}

Device {
  Name = LTO4-Drive-1
  Drive Index = 0
  Media Type = LTO-4
  Archive Device = /dev/tape/by-id/scsi-3500110a0008dde59-nst
  ...
}

Device {
  Name = LTO4-Drive-2
  Drive Index = 1
  Media Type = LTO-4
  Archive Device = /dev/tape/by-id/scsi-3500110a0008dde5f-nst
  ...
}

The by-id name will not change between reboots.

 -Thomas

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] catalog problem: duplicate key value violates unique constraint "fileset_pkey"

2014-01-15 Thread Dimitri Maziuk
On 01/15/2014 02:54 PM, Wolfgang Denk wrote:
> Dear Dimitri,

>>>   Basically whay I did is dumping the DB
>>> under MySQL
>>
>>> and then importing the dump into PostgreSQL.
>>
>> That's why the sequences didn't get reinitialized properly.
> 
> Would there have been a better way to do that?

Nope. The way to do it is what you've done: for each
sequence/table+autoincrement-column select max(column) and then alter
sequence.

-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu



signature.asc
Description: OpenPGP digital signature
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] SOLVED: catalog problem: duplicate key value violates unique constraint "fileset_pkey"

2014-01-15 Thread Wolfgang Denk
Dear Thomas,

In message <52d59d74.6000...@mtl.mit.edu> you wrote:
>
> I can't say exactly why it happened to you but my guess would be that 
> this problem could hit anyone porting from mysql to postgres.  I'm not 

It seems so.  Now that I'm through all this I found a link [1] which
desribes exactly this problem.  Can't say why my searches didn;tfind
that earlier.

> familiar with the Bacula procedure for doing that (if you used one) but 
> any Postgres sequence creations during the Postgres DB setup would more 
> than likely be created with a default starting value of 1 - but if 
> you've already got data in your database (migrated over from Mysql) then 
> all sequences would need to be seeded properly.  The bad news for you 
> may be that almost all of the Bacula tables have sequences to generate 
> their id fields.
> 
> client
> file
> filename
> path
> job
> jobmedia
> fileset
> media
> pool

There are more:

bacula=# SELECT c.relname FROM pg_class c WHERE c.relkind = 'S';
  relname  
---
 filename_filenameid_seq
 job_jobid_seq
 location_locationid_seq
 restoreobject_restoreobjectid_seq
 fileset_filesetid_seq
 client_clientid_seq
 media_mediaid_seq
 jobmedia_jobmediaid_seq
 mediatype_mediatypeid_seq
 device_deviceid_seq
 basefiles_baseid_seq
 locationlog_loclogid_seq
 log_logid_seq
 path_pathid_seq
 pool_poolid_seq
 file_fileid_seq
 storage_storageid_seq
(17 rows)

> I believe in each case, the 'id' field is the primary key which means it 
> will be unique - thus any inserts should fail with an error and thus 
> ensure that your database doesn't get into a strange funky state with 
> multiple records having the same id.  It may also be that you get lucky 
> and avoid that for tables such as file, job, filename because if your 
> database had been around awhile, it may be that re-starting those 
> counters back to 1 may not overlap with any existing/current data (e.g. 
> if the newest job before migration had an id of 1 and all old jobs 
> have been purged then restarting at 1 shouldn't cause problems depending 
> on your configuration of course).  With that said, if it was me, I'd 
> re-seed all the sequences to where the id left off for each of the 
> tables to avoid possible future insert errors/conflicts.

Indeed this appears what needs to be done...

> alter sequence fileset_filesetid_seq restart with 76;

This is what I did, i. e. for example:

...
bacula=# select max(fileid) from file;
max 

 4350001202
(1 row)

bacula=# select * from file_fileid_seq;
  sequence_name  | last_value | start_value | increment_by |  max_value 
 | min_value | cache_value | log_cnt | is_cycled | is_called 
-++-+--+-+---+-+-+---+---
 file_fileid_seq |  1 |   1 |1 | 
9223372036854775807 | 1 |   1 |   0 | f | f
(1 row)

bacula=# alter sequence file_fileid_seq restart with 4350001203;
ALTER SEQUENCE

...

Accoding to [1] this could have been simplified, but I didn't know
this then yet (and I hope I will never have to do this again).

> hope this helps and good luck,

It did.  Thanks a lot for your help - I highly appreciate it.
If we ever should run into each other in real life please remember me
that I owe you some beer...

[1] 
http://mtu.net/~jpschewe/blog/2010/06/migrating-bacula-from-mysql-to-postgresql/

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Don't panic.

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] A matter of timing

2014-01-15 Thread Steven Hammond
I have our disk to disk running at 18:00 (priority 20).  I have the disk to 
tape scheduled for 20:00 (priority 90).  I'm curious since my disk to tape 
(copy) job uses a sql query when does that query actually execute?  In other 
words, if I scheduled the disk to tape job at the same time as the disk to disk 
job (18:00) but using a priority of 90 so that it is after the disk to disk 
jobs, will the sql query be executed as soon as it gets run but it is WAITING 
for the others (disk job) to finish?  Or will it execute the query to find the 
jobs to copy when it actually starts running (all the disk jobs are complete)?

Steven Hammond
I.T. Manager
Technical Chemical Company

For support, please email us at supp...@technicalchemical.com.


-Original Message-
From: Wolfgang Denk [mailto:w...@denx.de] 
Sent: Wednesday, January 15, 2014 2:55 PM
To: thom...@mtl.mit.edu
Cc: bacula-users@lists.sourceforge.net
Subject: Re: [Bacula-users] catalog problem: duplicate key value violates 
unique constraint "fileset_pkey"

Dear Thomas,

In message <52d6a29a.6010...@mtl.mit.edu> you wrote:
>
> > I ran this under "bconsole", i. e. as user bacula - is this not the
> > right thing to do?
...
> As someone I think already pointed out, it sounds like the owner of your 
> bacula database sequences is another user - more than likely the 
> Postgres "super user" which is probably named something like 'postgres' 
> on your system I'm guessing.  You will need to connect to the database 
> as that user in order to have update privileges on the sequences.

You were right once more.  Running as "postgres" worked fine.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Microsoft Multimedia:
You have nice graphics, sound and animations when the system crashes.

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] catalog problem: duplicate key value violates unique constraint "fileset_pkey"

2014-01-15 Thread Wolfgang Denk
Dear Thomas,

In message <52d6a29a.6010...@mtl.mit.edu> you wrote:
>
> > I ran this under "bconsole", i. e. as user bacula - is this not the
> > right thing to do?
...
> As someone I think already pointed out, it sounds like the owner of your 
> bacula database sequences is another user - more than likely the 
> Postgres "super user" which is probably named something like 'postgres' 
> on your system I'm guessing.  You will need to connect to the database 
> as that user in order to have update privileges on the sequences.

You were right once more.  Running as "postgres" worked fine.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Microsoft Multimedia:
You have nice graphics, sound and animations when the system crashes.

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] catalog problem: duplicate key value violates unique constraint "fileset_pkey"

2014-01-15 Thread Wolfgang Denk
Dear Dimitri,

In message <52d5c764.4050...@bmrb.wisc.edu> you wrote:
>
> > I didn't use any precanned procedure (is there one? I mean a
> > recommended/working one?).  Basically whay I did is dumping the DB
> > under MySQL=20
> 
> > and then importing the dump into PostgreSQL.
> 
> That's why the sequences didn't get reinitialized properly.

Would there have been a better way to do that?

> > Enter SQL query: alter sequence fileset_filesetid_seq restart with =
> 76;
> > Query failed: ERROR:  must be owner of relation fileset_filesetid_s=
> eq
> 
> Interesting... "select current_user" will tell you what role name
> bconsole is using.

It was "postgres".

> With psql you can connect as any role:
> 
> psql -U  -d 

Indeed, running as user "postgres" fixed the issue.

Thanks a lot!

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
God is real, unless declared integer.

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Help binding scsi address to tape library

2014-01-15 Thread Luis G. Alford G.
Hi

I have installed a bacula server and it works ok but when I reboot the
server the tape drive change's it's  scsi address when I reboot the server
it is via FC .  any idea what i can do to avoid this from happen

waiting for your soon replay
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] bacula-fd failing

2014-01-15 Thread Troy Kocher
I'm having issues with bacula-fd failing on our Redhat server.  I'm also having 
difficulty finding detail on where to configure the client's verbosity, 
/var/log/bacula is empty as is the messages log.  Not sure what caused this 
issue. This installation has been in place for some time and only recently 
began failing.  

installed 
bacula-client.x86_64   2.4.4-12.el5installed
bacula-common.x86_64   2.4.4-12.el5installed
on RHEL5

--bacula-fd.conf--

Director {
  Name = krustykrab-dir
  Password = "witheld"
}

#
# "Global" File daemon configuration specifications
#
FileDaemon {  # this is me
  Name = servername-fd
  FDport = 9102  # where we listen for the director
  WorkingDirectory = /var/spool/bacula
  Pid Directory = /var/run
  Maximum Concurrent Jobs = 20

Any input would be appreciated!

Thanks 
Troy Kocher

_
Scanned by IBM Email Security Management Services 
powered by MessageLabs.
_

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] catalog problem: duplicate key value violates unique constraint "fileset_pkey"

2014-01-15 Thread Thomas Lohman
> I tried that, but it fails:
>
>  Enter SQL query: alter sequence fileset_filesetid_seq restart with 76;
>  Query failed: ERROR:  must be owner of relation fileset_filesetid_seq
>
> I ran this under "bconsole", i. e. as user bacula - is this not the
> right thing to do?

Wolfgang,

As someone I think already pointed out, it sounds like the owner of your 
bacula database sequences is another user - more than likely the 
Postgres "super user" which is probably named something like 'postgres' 
on your system I'm guessing.  You will need to connect to the database 
as that user in order to have update privileges on the sequences.

hope this helps,


--tom



--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Save parts of backup as .zip?

2014-01-15 Thread hendrik
thanks a lot.
seems very hard as I never wrote such a complex script before, but I will try :)

I really appreciate your amazing reply, thanks again!

+--
|This was sent by hendrik.hoerm...@comspace.de via Backup Central.
|Forward SPAM to ab...@backupcentral.com.
+--



--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users