Re: [Bacula-users] Volumes are not being recycled?

2016-02-18 Thread Kern Sibbald
By the way, the "SQLite not supported" comment is more accurately stated "Bacula does not support SQLite any more, though the code still exists, we never test it." Yes, non-standard SQL makes devloper's lives much more complicated. Best regards, Kern On 02/18/2016 11:20 PM, Dimitri Maziuk wrot

Re: [Bacula-users] Volumes are not being recycled?

2016-02-18 Thread Kern Sibbald
Well this is one step forward for Postgres, though it would require a database change ... Now lets see what comes up for MySQL Best regards, Kern On 02/19/2016 03:16 AM, Dimitri Maziuk wrote: > On 02/18/2016 08:44 AM, Phil Stracchino wrote: >> On 02/18/16 09:38, Dimitri Maziuk wrote: >>> MySQL

Re: [Bacula-users] Volumes are not being recycled?

2016-02-18 Thread Kern Sibbald
LastWritten is stored in whatever time your system is configured to use. Bacula has no concept of UTC, and typically uses only localtime when printing dates (unless the field is maintained by SQL). As you point out, if you are running Bacula components in different timezones this may or may no

Re: [Bacula-users] Volumes are not being recycled?

2016-02-18 Thread Dimitri Maziuk
PS. Alan's query: select volumename,date( lastwritten + interval '1 second' * volretention ) from media; works in postgres, so that's portable between the two. It's an error in sqlite. -- Dimitri Maziuk Programmer/sysadmin BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu signature.asc D

Re: [Bacula-users] Volumes are not being recycled?

2016-02-18 Thread Dimitri Maziuk
On 02/18/2016 08:44 AM, Phil Stracchino wrote: > On 02/18/16 09:38, Dimitri Maziuk wrote: >> MySQL can disagree with whatever it wants, but INTERVAL is an ANSI >> SQL-92 *datatype* and the link you posted describes a bunch of >> *functions* with no hint of standards compliance. There is a differe

Re: [Bacula-users] Volumes are not being recycled?

2016-02-18 Thread Alan Brown
Add the attached queries to query.sql They are postgresql-specific and may not work first time on Mysql (but they started out as mysql queries) I have a few ancilliary (nasty, horrible spaghetti code) bash scripts which will load/unload a changer from/to the magazine/IOslots(*) and to tell op

Re: [Bacula-users] Volumes are not being recycled?

2016-02-18 Thread Phil Stracchino
On 02/18/16 09:38, Dimitri Maziuk wrote: > MySQL can disagree with whatever it wants, but INTERVAL is an ANSI > SQL-92 *datatype* and the link you posted describes a bunch of > *functions* with no hint of standards compliance. There is a difference. I'm sorry, I misunderstood. I didn't realize

Re: [Bacula-users] Volumes are not being recycled?

2016-02-18 Thread Dimitri Maziuk
On 2016-02-18 07:25, Phil Stracchino wrote: > Wait, Dimitri, are you saying MySQL doesn't do intervals? > > https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html > http://stackoverflow.com/questions/2793619/working-with-interval-and-curdate-in-mysql > > MySQL disagrees with you. My

Re: [Bacula-users] Volumes are not being recycled?

2016-02-18 Thread Phil Stracchino
On 02/18/16 08:20, Dimitri Maziuk wrote: > On 2016-02-18 01:38, Kern Sibbald wrote: >> Hello, >> >> That may be a solution. I am not particularly worried about SQLite as it >> is no longer supported. However, what I do need is a patch that will >> work for both MySQL (MariaDB as well) and PostgreS

Re: [Bacula-users] Volumes are not being recycled?

2016-02-18 Thread Dimitri Maziuk
On 2016-02-18 01:38, Kern Sibbald wrote: > Hello, > > That may be a solution. I am not particularly worried about SQLite as it > is no longer supported. However, what I do need is a patch that will > work for both MySQL (MariaDB as well) and PostgreSQL. Yeah, well, mysql's never been in the busin

Re: [Bacula-users] Volumes are not being recycled?

2016-02-18 Thread Ana Emília M . Arruda
Hello Kern ​, ​ I noticed that LastWritten value is stored in UTC. Therefore the results of both queries are in UTC. These values can be converted to ​ ​ the ​ ​ database session ​ ​ local times. Unfortunately, the local ​ ​ time for a user issuing this query through bconsole can be different from

Re: [Bacula-users] Volumes are not being recycled?

2016-02-17 Thread Kern Sibbald
Hello Ana, It may be possible that your code would work. However, please be aware that it was *very* complicated to get the current code to produce the right results. It is very easy to get an answer that is wrong by 1 hour or something like that. Thus anything that one would submit would ne

Re: [Bacula-users] Volumes are not being recycled?

2016-02-17 Thread Kern Sibbald
Hello, Yes, it is the list_result() function in src/cats/sql.c that is a very generic routine for outputting "list" results. I personally cannot be of much help, but there are a good number of SQL experts using Bacula. Best regards, Kern On 02/18/2016 10:29 AM, Wanderlei Huttel wrote: > Hello

Re: [Bacula-users] Volumes are not being recycled?

2016-02-17 Thread Kern Sibbald
Hello, That may be a solution. I am not particularly worried about SQLite as it is no longer supported. However, what I do need is a patch that will work for both MySQL (MariaDB as well) and PostgreSQL. Some sort of stored function may also be appropriate. Best regards, Kern On 02/18/2016 10

Re: [Bacula-users] Volumes are not being recycled?

2016-02-17 Thread Ana Emília M . Arruda
Hello Kern, Thank you for your clear explanation. I was thinking about an "ExpiresAt" field instead of an "ExpiresIn". The meaning of an ExpiresIn field is perfectly clear for me expressed in seconds. Also, I agree that the results from bconsole commands should be less human-readable since we have

Re: [Bacula-users] Volumes are not being recycled?

2016-02-17 Thread Wanderlei Huttel
Hello Guys I was trying to create a function to convert seconds and bytes to more "human readable". If I'm right, the file that shows information in bconsole is src/cats/sql.c, function list_result. How the function list_result didn't check the name of fields, I guess is necessary to check the na

Re: [Bacula-users] Volumes are not being recycled?

2016-02-17 Thread Dimitri Maziuk
On 02/17/2016 05:58 PM, Kern Sibbald wrote: > Hello Heitor, > > One of the basic design conditions for Bacula is that as much as > possible that goes into it officially should be understandable and > maintainable by an average C/C++ programmer. Once things start getting > complicated, I slow d

Re: [Bacula-users] Volumes are not being recycled?

2016-02-17 Thread Kern Sibbald
Hello Heitor, One of the basic design conditions for Bacula is that as much as possible that goes into it officially should be understandable and maintainable by an average C/C++ programmer. Once things start getting complicated, I slow down ... Best regards, Kern On 02/18/2016 08:25 AM, Hei

Re: [Bacula-users] Volumes are not being recycled?

2016-02-17 Thread Heitor Faria
Kern, Sorry for the dumb question but could not bconsole make the values conversion in similar way to this shell script bytes conversion snippet before printing? xargs -i echo 'scale=2; {}/1073741824' | bc May it would be a more database independent approach. Regards, =

Re: [Bacula-users] Volumes are not being recycled?

2016-02-17 Thread Kern Sibbald
Hello Ana (and Heitor), Please note that at the current time, the list command is generic, and thus it only knows how to print character strings that have been returned by the SQL engine. Though there may be some way to tell SQL that the result we get for expiresin is a "duration" (note: very

Re: [Bacula-users] Volumes are not being recycled?

2016-02-16 Thread Gary R. Schmidt
On 2016-02-17 07:59, Heitor Faria wrote: Hello Kern and Heitor, >> >>> I really like the new "expiresin" field, it is quite helpful. >>> >>> I agree with Ana about the formatting of it though - Even though we >>> are >>> pushing the envelope with regards to the column width of the "list >>

Re: [Bacula-users] Volumes are not being recycled?

2016-02-16 Thread Wanderlei Huttel
Hello Heitor I've made some changes that could help you, but I guess, just will work in MySQL and I don't know if could have some another performance impact. 1st) Create a function in MySQL to convert bytes to human readable and run some commands: mysql -u root -D bacula < /tmp/function_conver

Re: [Bacula-users] Volumes are not being recycled?

2016-02-16 Thread Dan Langille
> On Feb 16, 2016, at 3:59 PM, Heitor Faria wrote: > Hello Kern and Heitor, >> >>> I really like the new "expiresin" field, it is quite helpful. >>> >>> I agree with Ana about the formatting of it though - Even though we are >>> pushing the envelope with regards to the column width of the

Re: [Bacula-users] Volumes are not being recycled?

2016-02-16 Thread Heitor Faria
>>> Hello Kern and Heitor, > >> I really like the new "expiresin" field, it is quite helpful. >> >> I agree with Ana about the formatting of it though - Even though we are >> pushing the envelope with regards to the column width of the "list media" >> output. :) Hello, Bill: that´s the beauty of

Re: [Bacula-users] Volumes are not being recycled?

2016-02-16 Thread Bill Arlofski
On 02/16/2016 04:19 AM, Ana Emília M. Arruda wrote: > Hello Kern and Heitor, > > I can see the ExpiresIn field in Bacula 7.4.0 version. > Maybe the ExpiresIn value could be more useful if displayed in the same format > as the LastWritten field. > > Best regards, > Ana I really like the new "expi

Re: [Bacula-users] Volumes are not being recycled?

2016-02-16 Thread Ana Emília M . Arruda
Hello Kern and Heitor, I can see the ExpiresIn field in Bacula 7.4.0 version. Maybe the ExpiresIn value could be more useful if displayed in the same format as the LastWritten field. Best regards, Ana On Tue, Feb 16, 2016 at 2:46 AM, Heitor Faria wrote: > >>> Recently I got tired of doing the

Re: [Bacula-users] Volumes are not being recycled?

2016-02-15 Thread Heitor Faria
or Faria" > To: "Kern Sibbald" > Cc: "John Drescher" , "Bacula Users" > > Sent: Monday, February 15, 2016 11:46:14 PM > Subject: Re: [Bacula-users] Volumes are not being recycled? >>>> Recently I got tired of doing the mental gymnas

Re: [Bacula-users] Volumes are not being recycled?

2016-02-15 Thread Heitor Faria
>>> Recently I got tired of doing the mental gymnastics to see when Volumes >>> will expire and with Eric's SQL help, we modified the list (and llist) >>> media output to eliminate one or two of the columns in the case of list >>> media, but to add an "expiresin" field, which makes it much easier t

Re: [Bacula-users] Volumes are not being recycled?

2016-02-15 Thread Kern Sibbald
On 02/16/2016 09:22 AM, Heitor Faria wrote: >> Hello, >> >> Recently I got tired of doing the mental gymnastics to see when Volumes >> will expire and with Eric's SQL help, we modified the list (and llist) >> media output to eliminate one or two of the columns in the case of list >> media, but to

Re: [Bacula-users] Volumes are not being recycled?

2016-02-15 Thread Heitor Faria
> Hello, > > Recently I got tired of doing the mental gymnastics to see when Volumes > will expire and with Eric's SQL help, we modified the list (and llist) > media output to eliminate one or two of the columns in the case of list > media, but to add an "expiresin" field, which makes it much easi

Re: [Bacula-users] Volumes are not being recycled?

2016-02-15 Thread Kern Sibbald
Hello, Recently I got tired of doing the mental gymnastics to see when Volumes will expire and with Eric's SQL help, we modified the list (and llist) media output to eliminate one or two of the columns in the case of list media, but to add an "expiresin" field, which makes it much easier to se

Re: [Bacula-users] Volumes are not being recycled?

2016-02-15 Thread John Drescher
On Mon, Feb 15, 2016 at 3:55 PM, SPQR wrote: > Hello, > > I recently executed > > update pool from resource > > update all volumes in pool > > > in bconsole. > > > This is the result: > > +++-+-+-++-+--+---

[Bacula-users] Volumes are not being recycled?

2016-02-15 Thread SPQR
Hello, I recently executed update pool from resource update all volumes in pool in bconsole. This is the result: +++-+-+-++-+--+++-+---+---+---

Re: [Bacula-users] Volumes are not being recycled?

2016-02-15 Thread John Drescher
On Mon, Feb 15, 2016 at 3:15 PM, SPQR wrote: > Yes, but: Why? > > I defined 7 days in my config. Is it using 14 days? > I will copy my 2nd email here: "BTW, Your retention period is 1209600 seconds (14 days). If you changed that in bacula-dir.conf with existing volumes you need to execute updat

[Bacula-users] Volumes are not being recycled?

2016-02-15 Thread SPQR
Yes, but: Why? I defined 7 days in my config. Is it using 14 days? +-- |This was sent by r...@ehrenwert.it via Backup Central. |Forward SPAM to ab...@backupcentral.com. +---

Re: [Bacula-users] Volumes are not being recycled?

2016-02-15 Thread John Drescher
> Hi and thank you for your reply. > > Why should the volumes be older than 14 days? I defined > > Volume Retention = 7 days > > > Or did I misunderstand your point? I explained that in my second email. Your volumes have a 1209600 second retention period from your output. John --

[Bacula-users] Volumes are not being recycled?

2016-02-15 Thread SPQR
Hi and thank you for your reply. Why should the volumes be older than 14 days? I defined Volume Retention = 7 days Or did I misunderstand your point? +-- |This was sent by r...@ehrenwert.it via Backup Central. |Forward SPAM

Re: [Bacula-users] Volumes are not being recycled?

2016-02-15 Thread Wanderlei Huttel
That's the point! John already answered! Best Regards Wanderlei Atenciosamente *Nome **|* *Wanderlei Hüttel* *Blog* | http://www.huttel.com.br 2016-02-15 14:08 GMT-02:00 John Drescher : > On Mon, Feb 15, 2016 at 11:02 AM, John Drescher > wrote: > > On Mon, Feb 15, 2016 at 10:55 AM, SPQR

Re: [Bacula-users] Volumes are not being recycled?

2016-02-15 Thread John Drescher
On Mon, Feb 15, 2016 at 11:02 AM, John Drescher wrote: > On Mon, Feb 15, 2016 at 10:55 AM, SPQR wrote: >> Oh, the output is really heavy: >> >> >> *list media pool=Silver >> Automatically selected Catalog: MyCatalog >> Using Catalog "MyCatalog" >> +-++---+-+---

Re: [Bacula-users] Volumes are not being recycled?

2016-02-15 Thread John Drescher
On Mon, Feb 15, 2016 at 10:55 AM, SPQR wrote: > Oh, the output is really heavy: > > > *list media pool=Silver > Automatically selected Catalog: MyCatalog > Using Catalog "MyCatalog" > +-++---+-+---+--+--+-+--+-

[Bacula-users] Volumes are not being recycled?

2016-02-15 Thread SPQR
Oh, the output is really heavy: *list media pool=Silver Automatically selected Catalog: MyCatalog Using Catalog "MyCatalog" +-++---+-+---+--+--+-+--+---+---+-+ | mediaid | volumenam

Re: [Bacula-users] Volumes are not being recycled?

2016-02-15 Thread Wanderlei Huttel
Send the file /tmp/media.txt *@tee /tmp/media.txt *list media pool=Silver Atenciosamente *Nome **|* *Wanderlei Hüttel* *Blog* | http://www.huttel.com.br 2016-02-15 13:28 GMT-02:00 SPQR : > Hello, > > I'm using bacula to backup some servers but I mentioned that old volumes > are not being re

[Bacula-users] Volumes are not being recycled?

2016-02-15 Thread SPQR
Hello, I'm using bacula to backup some servers but I mentioned that old volumes are not being recycled and can not be reused: 593 Fullpp-test-www.2016-02-14_02.05.07_58 is waiting for an appendable Volume This is my fileset-conf: > > FileSet { > Name = Common > Include { > O