How to run bconsole commands in a bash for loop?

Gary Dale <[email protected]>
Newsgroups gmane.comp.bacula.user
Message-ID <[email protected]>
Internet searches have been futile. The ones that actually mention 
bconsole suggest what I've been trying to do should work, but it doesn't.

Through my initial setup struggles, my storage volumes have become a 
disjointed mess. To make matters worse, there are close to a hundred 
volumes showing "Error" when I "List Volumes". I have only about 20 that 
show up as physical disk volumes. And automatic volume creation seems to 
be failing. All my backups for the last 5 days have failed.

To fix this, I'm trying to go back to the start (without purging and 
reinstalling bacula) by removing everything to date. However, I can't do 
that for the volumes - way to many of them. So I'm trying to run a bash 
script to cycle through them to purge them.

I've found multiple answers that suggest using a bash for loop then 
doing something like:
         echo "purge volume ${volname} yes" | bconsole  - where $volname 
is created by the for loop -
should work. And it does actually to a point. It will invoke the "purge 
volume" dialogue then asks which pool to use. Inserting the pool number 
after the volume command (e.g. echo "purge volume 2 ${volname} yes" | 
bconsole) doesn't work either. Nor does inserting \n into the echoed 
command at various points.

Being able to put bconsole commands into a bash script seems like 
something that will be generally useful but I can't find a way to make 
it work.

Any ideas?



_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.