Re: [Bacula-users] needed tapes

2025-03-21 Thread Stefan G. Weichinger via Bacula-users
Am 20.03.25 um 15:59 schrieb Rob Gerber: Stefan, Here is some information to assist with crafting postgres sql queries. The postgres psql shell provides tools to look up tables and their columns so you know what keywords to specify in your queries. You can also easily test queries and get fee

Re: [Bacula-users] needed tapes

2025-03-20 Thread Rob Gerber
I haven't seen it explicitly explained in this thread, so here is some information about the bconsole query command. Throughout this email, I will assume you installed bacula using the bacula community repositories, which installs bacula in the /opt/bacula/ folder by default. If your bacula files

Re: [Bacula-users] needed tapes

2025-03-20 Thread Rob Gerber
Stefan, Here is some information to assist with crafting postgres sql queries. The postgres psql shell provides tools to look up tables and their columns so you know what keywords to specify in your queries. You can also easily test queries and get feedback. psql will tell you when you've made a s

Re: [Bacula-users] needed tapes

2025-03-20 Thread Stefan G. Weichinger via Bacula-users
Am 19.03.25 um 11:52 schrieb Gary R. Schmidt: Look up what the PoolId for "Daily" is from Pool and use Media.PoolId = Whatever_That_Is rather than the non-existent (in my version of bacula) Media.Pool. I had tried that, but with errors. Retried, rm-ed the JOIN and Pool.Name from the SELECT,

Re: [Bacula-users] needed tapes

2025-03-19 Thread Gary R. Schmidt
On 19/3/25 21:36, Stefan G. Weichinger via Bacula-users wrote: ok, I now have: # cat bacula_tapes.sh #!/bin/bash echo -e "sql\nSELECT Media.MediaId, Media.VolumeName, Media.PoolId, Pool.Name AS Pool, Media.Slot,\     Media.Slot <> 0 AS InChanger, Media.FirstWritten, Media.LastWritten, Me

Re: [Bacula-users] needed tapes

2025-03-19 Thread Stefan G. Weichinger via Bacula-users
ok, I now have: # cat bacula_tapes.sh #!/bin/bash echo -e "sql\nSELECT Media.MediaId, Media.VolumeName, Media.PoolId, Pool.Name AS Pool, Media.Slot,\ Media.Slot <> 0 AS InChanger, Media.FirstWritten, Media.LastWritten, Media.VolStatus, \ GREATEST(0, (extract('epoch' from LastWr

Re: [Bacula-users] needed tapes

2025-03-17 Thread Martin Simmons
> On Fri, 14 Mar 2025 14:21:15 +, Bill Arlofski via Bacula-users said: > > In a script, you can do: > > > echo -e "sql\nSELECT..ORDER BY volumename INC;\n\nquit\n" | bconsole > > > The echo -e: enable interpretation of backslash escapes > > The `\n` in the script are line feeds.

Re: [Bacula-users] needed tapes

2025-03-17 Thread Stefan G. Weichinger via Bacula-users
Am 14.03.25 um 15:21 schrieb Bill Arlofski via Bacula-users: On 3/14/25 4:03 AM, Stefan G. Weichinger via Bacula-users wrote: Am 14.03.25 um 07:48 schrieb Stefan G. Weichinger via Bacula-users: I use an 8-slot autoloader, I added a little bit of SQL to the query file and just run that, it list

Re: [Bacula-users] needed tapes

2025-03-15 Thread Gary R. Schmidt
On 16/3/25 08:48, Bill Arlofski wrote: On Friday, March 14th, 2025 at 21:27, Gary R. Schmidt wrote: On 15/3/25 01:24, Bill Arlofski via Bacula-users wrote: On 3/14/25 5:22 AM, Gary R. Schmidt wrote: As a cronjob I'd put "echo query 22 | bconsole" in a file and execute that. Cheers

Re: [Bacula-users] needed tapes

2025-03-15 Thread Bill Arlofski via Bacula-users
On Friday, March 14th, 2025 at 21:27, Gary R. Schmidt wrote: > On 15/3/25 01:24, Bill Arlofski via Bacula-users wrote: > > > On 3/14/25 5:22 AM, Gary R. Schmidt wrote: > > > > > As a cronjob I'd put "echo query 22 | bconsole" in a file and execute > > > that. > > > > > > Cheers, > > > Gary

Re: [Bacula-users] needed tapes

2025-03-15 Thread Gary R. Schmidt
On 13/3/25 18:14, Stefan G. Weichinger via Bacula-users wrote: thanks all for your replies and explanations. It wasn't my intention to let somebody else do my work, no :-) I see the complexity somehow, and wonder if I can at least come up with something that *helps* choosing the next 8 tapes

Re: [Bacula-users] needed tapes

2025-03-14 Thread Gary R. Schmidt
On 15/3/25 01:24, Bill Arlofski via Bacula-users wrote: On 3/14/25 5:22 AM, Gary R. Schmidt wrote: As a cronjob I'd put "echo query 22 | bconsole" in a file and execute that. Cheers,     Gary    B-) This will not work. :) Works perfectly for me: $ echo "echo query 22 | bconsole"

Re: [Bacula-users] needed tapes

2025-03-14 Thread Bill Arlofski via Bacula-users
On 3/14/25 5:22 AM, Gary R. Schmidt wrote: As a cronjob I'd put "echo query 22 | bconsole" in a file and execute that. Cheers, GaryB-) This will not work. :) But, you *could* do: 8< echo -e "query\n22\nquit\n" | bconsole 8< Best regards, Bill

Re: [Bacula-users] needed tapes

2025-03-14 Thread Bill Arlofski via Bacula-users
On 3/14/25 4:03 AM, Stefan G. Weichinger via Bacula-users wrote: Am 14.03.25 um 07:48 schrieb Stefan G. Weichinger via Bacula-users: I use an 8-slot autoloader, I added a little bit of SQL to the query file and just run that, it lists my tapes from last-used to most recent. I grab the three old

Re: [Bacula-users] needed tapes

2025-03-14 Thread Gary R. Schmidt
On 14/3/25 21:03, Stefan G. Weichinger via Bacula-users wrote: Am 14.03.25 um 07:48 schrieb Stefan G. Weichinger via Bacula-users: I use an 8-slot autoloader, I added a little bit of SQL to the query file and just run that, it lists my tapes from last-used to most recent. I grab the three oldes

Re: [Bacula-users] needed tapes

2025-03-14 Thread Stefan G. Weichinger via Bacula-users
Am 14.03.25 um 07:48 schrieb Stefan G. Weichinger via Bacula-users: I use an 8-slot autoloader, I added a little bit of SQL to the query file and just run that, it lists my tapes from last-used to most recent. I grab the three oldest, move them to the Scratch pool, purge them, and replace the t

Re: [Bacula-users] needed tapes

2025-03-13 Thread Stefan G. Weichinger via Bacula-users
Am 13.03.25 um 13:09 schrieb Gary R. Schmidt: On 13/3/25 18:14, Stefan G. Weichinger via Bacula-users wrote: thanks all for your replies and explanations. It wasn't my intention to let somebody else do my work, no :-) I see the complexity somehow, and wonder if I can at least come up with so

Re: [Bacula-users] needed tapes

2025-03-13 Thread Stefan G. Weichinger via Bacula-users
thanks all for your replies and explanations. It wasn't my intention to let somebody else do my work, no :-) I see the complexity somehow, and wonder if I can at least come up with something that *helps* choosing the next 8 tapes each week. Currently mostly I select the tapes, I am the exte

Re: [Bacula-users] needed tapes

2025-03-12 Thread Radosław Korzeniewski
Hi, wt., 11 mar 2025 o 21:12 Bill Arlofski via Bacula-users < bacula-users@lists.sourceforge.net> napisał(a): > > Here's why I say "guessed": > > I have a story - I had multiple jobs one day and the Director "guessed" all can come to the single tape, because this was available, but not all fit in

Re: [Bacula-users] needed tapes

2025-03-12 Thread Bill Arlofski via Bacula-users
On 3/12/25 5:09 AM, Radosław Korzeniewski wrote: Hi, wt., 11 mar 2025 o 21:12 Bill Arlofski via Bacula-users mailto:bacula- us...@lists.sourceforge.net>> napisał(a): Here's why I say "guessed": I have a story - I had multiple jobs one day and the Director "guessed" all can come to the

Re: [Bacula-users] needed tapes

2025-03-11 Thread Bill Arlofski via Bacula-users
On 3/11/25 1:29 PM, Dragan Milivojević wrote: You are basically asking if someone can transfer your thought process and reasoning into a custom script. Unless there are mind readers here ;) that is not going to happen. Describe your selection process in an algorithmic way and transfer that into

Re: [Bacula-users] needed tapes

2025-03-11 Thread Dragan Milivojević
You are basically asking if someone can transfer your thought process and reasoning into a custom script. Unless there are mind readers here ;) that is not going to happen. Describe your selection process in an algorithmic way and transfer that into a bash shell. If you are adventurous try ChatGPT,

Re: [Bacula-users] needed tapes

2025-03-11 Thread Stefan G. Weichinger via Bacula-users
Am 04.03.25 um 08:17 schrieb Stefan G. Weichinger via Bacula-users: So basically I look into the "Volumes" part of Bacularis, look for status "Append" or "Used", and take the tapes that are already overwritable again. And I look at the tapes in the loader which are full -> take them out and

Re: [Bacula-users] needed tapes

2025-03-03 Thread Stefan G. Weichinger via Bacula-users
Am 03.03.25 um 17:37 schrieb Rob Gerber: Stefan, Can you share some details about your current process to predict what media will be needed, including information about your pools and volumes inside them? Sure. At first: thanks for offering your help! - Basically we run one schedule with

Re: [Bacula-users] needed tapes

2025-03-03 Thread Rob Gerber
In this email I will give some examples on how to send a command to bconsole from within a shell script. I will attach one of my shell scripts that *DOES NOT do what you need.* It is provided only as an example of how a shell script could be made to interact with bacula. There is some error checkin

Re: [Bacula-users] needed tapes

2025-03-03 Thread Rob Gerber
Stefan, Can you share some details about your current process to predict what media will be needed, including information about your pools and volumes inside them? I am not aware of a tool that forecasts what media will be needed by jobs scheduled in the future, but that doesn't mean that such a