Re: running bconsole commands in bash script

Kees Bakker via Bacula-users <[email protected]>
Newsgroups gmane.comp.bacula.user
Message-ID <[email protected]>
Perhaps you want to do it like this

                  for vol in `echo ${vol_list}`
                  do
                                   echo “purge volume=$vol yes”
                  done | bconsole

or

                  for vol in ${vol_list}
                  do
                                   echo “purge volume=$vol yes”
                  done | bconsole

On 20-06-2025 14:11, Yateen Shaligram Bhagat (Nokia) via Bacula-users wrote:
> Hi All,
>
> We are using bacula 13.x.
>
> As part of the periodic garbage collection activity, we do purging and 
> truncating of the stranded disk volumes (volumes that have no jobs 
> associated with them) to conserve the disk space.
>
> We do it running a bash script that first identifies such stranded 
> volumes (at times hundreds of them) and then it purges each volume 
> through a “for loop” with a bconsole  command as given below:
>
> *for vol in `echo ${vol_list}`*
>
> *                 do*
>
> *echo “purge volume=$vol yes” | bconsole*
>
> *done *
>
> However for every single iteration of the purge command in the loop 
> above, the script connects to the bacula-dir , which seems to be very 
> slow,  hence inefficient.
>
> Is there a  way to connect to the  bacula-dir only once and execute 
> the purge command for number of volumes in one go?
>
> -Yateen
>
>
>
> _______________________________________________
> Bacula-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bacula-users

_______________________________________________
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.