Discussion:
[bareos-users] [bareos-dbcheck] - Batch mode with "yes" as the default value
g***@gmail.com
2018-01-15 09:51:03 UTC
Permalink
Hello

Currently I use bareos version 16.2.

When I delete a bareos client, I use the command "bareos-dbcheck -b -D mysql -f"
The option "-b" makes it possible to use the command in batch mode thus in non-interactive mode.

However this command with the option "-b" ask me if I want to create a temporary index.
Example:

# / usr / sbin / bareos-dbcheck -b -D mysql -f
Checking for Paths without a trailing slash
Found 0 bad Path records.
Checking for Filenames with trailing slash
Found 0 bad Filename records.
Checking for duplicate Filename entries.
Found 0 duplicate Filename records.
Checking for duplicate Path entries.
Found 0 duplicate Path records.
Checking for orphaned JobMedia entries.
Checking for orphaned File entries. This may take some time!
Checking for orphaned Path entries. This may take some time!
Note. Index over the FilenameId column not found, that can greatly slow
down dbcheck.
Create temporary index? (yes / no):

Then I must enter "yes" manually. So the command is not in batch mode.

Sometimes the command asks several times to enter "yes" in order to create several different temporary indexes.
This variation depends on analyze of command "bareos-dbcheck".

Is it possible to use the command ("bareos-dbcheck -b -D mysql -f") in batch mode with "yes" as the default value?

Thank you in advance for your help
Regards
Knoax
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users+***@googlegroups.com.
To post to this group, send email to bareos-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Douglas K. Rand
2018-01-15 16:05:08 UTC
Permalink
Post by g***@gmail.com
When I delete a bareos client, I use the command "bareos-dbcheck -b -D
mysql -f" The option "-b" makes it possible to use the command in batch
mode thus in non-interactive mode.
However this command with the option "-b" ask me if I want to create a
temporary index. [...] Then I must enter "yes" manually. So the command is
not in batch mode.
Sometimes the command asks several times to enter "yes" in order to create
several different temporary indexes. This variation depends on analyze of
command "bareos-dbcheck".
Is it possible to use the command ("bareos-dbcheck -b -D mysql -f") in
batch mode with "yes" as the default value?
Ya, that is annoying isn't it? I "solved" the problem with this:

yes yes | /usr/local/sbin/bareos-dbcheck -f -b
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users+***@googlegroups.com.
To post to this group, send email to bareos-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jörg Steffens
2018-01-16 09:16:26 UTC
Permalink
Post by Douglas K. Rand
Post by g***@gmail.com
When I delete a bareos client, I use the command "bareos-dbcheck -b -D
mysql -f" The option "-b" makes it possible to use the command in batch
mode thus in non-interactive mode.
However this command with the option "-b" ask me if I want to create a
temporary index. [...] Then I must enter "yes" manually. So the command is
not in batch mode.
Sometimes the command asks several times to enter "yes" in order to create
several different temporary indexes. This variation depends on analyze of
command "bareos-dbcheck".
Is it possible to use the command  ("bareos-dbcheck -b -D mysql -f") in
batch mode with "yes" as the default value?
yes yes | /usr/local/sbin/bareos-dbcheck -f -b
Are you sure this is required even with bareos-17.2 and postgres backend?
--
Jörg Steffens ***@bareos.com
Bareos GmbH & Co. KG Phone: +49 221 630693-91
http://www.bareos.com Fax: +49 221 630693-10

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer:
S. Dühr, M. Außendorf, Jörg Steffens, P. Storz
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users+***@googlegroups.com.
To post to this group, send email to bareos-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g***@gmail.com
2018-01-17 09:36:58 UTC
Permalink
Post by Jörg Steffens
Post by Douglas K. Rand
Post by g***@gmail.com
When I delete a bareos client, I use the command "bareos-dbcheck -b -D
mysql -f" The option "-b" makes it possible to use the command in batch
mode thus in non-interactive mode.
However this command with the option "-b" ask me if I want to create a
temporary index. [...] Then I must enter "yes" manually. So the command is
not in batch mode.
Sometimes the command asks several times to enter "yes" in order to create
several different temporary indexes. This variation depends on analyze of
command "bareos-dbcheck".
Is it possible to use the command  ("bareos-dbcheck -b -D mysql -f") in
batch mode with "yes" as the default value?
yes yes | /usr/local/sbin/bareos-dbcheck -f -b
Are you sure this is required even with bareos-17.2 and postgres backend?
--
Bareos GmbH & Co. KG Phone: +49 221 630693-91
http://www.bareos.com Fax: +49 221 630693-10
Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
KomplementÀr: Bareos Verwaltungs-GmbH
S. DÃŒhr, M. Außendorf, Jörg Steffens, P. Storz
Hi Jörg

Thank you for your interest.

To answer your question, I don't know if it's still necessary with bareos-17.2 and postgres backend.

I tried bareos-17.2 and it was impossible to restore a single file with this version. I'm not the only one to have noticed it (see my post https://groups.google.com/forum/#!topic/bareos-users/MiAzxqhUVx8) and so I went back to the official version 16.2.

Moreover in my service we are forced to use mysql instead of postgresql.

Thank you again for your interest

Regards
Knoax
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users+***@googlegroups.com.
To post to this group, send email to bareos-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g***@gmail.com
2018-01-17 09:28:28 UTC
Permalink
Post by Douglas K. Rand
Post by g***@gmail.com
When I delete a bareos client, I use the command "bareos-dbcheck -b -D
mysql -f" The option "-b" makes it possible to use the command in batch
mode thus in non-interactive mode.
However this command with the option "-b" ask me if I want to create a
temporary index. [...] Then I must enter "yes" manually. So the command is
not in batch mode.
Sometimes the command asks several times to enter "yes" in order to create
several different temporary indexes. This variation depends on analyze of
command "bareos-dbcheck".
Is it possible to use the command ("bareos-dbcheck -b -D mysql -f") in
batch mode with "yes" as the default value?
yes yes | /usr/local/sbin/bareos-dbcheck -f -b
Hi Doug

Thank you very much for your answer.
I did not know the bash command "yes".
I learned a new command ^_^. thanks

However I used your command in a script with the option "set -o pipefail" and the command "yes yes" returns a error code not null.
So when I was running the command
# yes yes | / usr / local / sbin / bareos-dbcheck -f -b

I always had a not null return code and so I could not test result of my command.

So to solve my problem, I modified your command as follows

# printf 'yes% .0s \ n' {1..5} | / usr / sbin / bareos-dbcheck -b -f

Thanks again for your help

Regards
Knoax
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users+***@googlegroups.com.
To post to this group, send email to bareos-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...