Hello, John,

> Ok so there is no "magic" delete client command with Bacula which
> would do the whole job in one command, I now get that. So instead of
> using the SQL queries directly on the database I could use the
> "delete" command with bconsole for every type of resource used by that
> client but I still have one major problem: how can I find out in
> bconsole which volume for that specific client I need to delete? 

E.g. *list jobmedia client=hfaria-P65-fd
But you probably don't need that.
Just perform a:

*list jobs client=deprecated-fd

And delete the listed jobids.

*delete jobid=xx

You might also need to run a Bacula Shell dbcheck command to clean the Client 
unnecessary entries, as follows:

service bacula-dir stop
dbcheck -b /var/spool/bacula/
dbcheck -f /var/spool/bacula/
12) Eliminate orphaned Client records

> Best regards,

Please remove text trash from the email history when replying, such as 
Sourceforge ads.

Regards,

> John
> 
> On Sat, Jan 20, 2018 at 9:07 AM, Kern Sibbald <k...@sibbald.com> wrote:
>> Well,
>>
>> There is a delete command that deletes jobs, volumes, pools, and if I am not
>> mistaken jobids.  If you have a single job that handles multiple clients,
>> then the delete job will not be useful. I do not normally delete clients, so
>> I cannot say 100% how to do this but I suspect that with a small shell
>> script, you can delete each of the JobIds associated with the client.
>>
>> Best regards,
>>
>> Kern
>>
>>
>>
>> On 19.01.2018 21:14, John Naggets wrote:
>>>
>>> Kern, that's exactly what I would like to do: I would like to delete
>>> properly and safely a client using the bacula tools for that purpose.
>>>
>>> Can you let me know which command(s) I need to use in bconsole in
>>> order to remove properly a client?
>>>
>>> Regards,
>>> John
>>>
>>> On Fri, Jan 19, 2018 at 6:46 PM, Kern Sibbald <k...@sibbald.com> wrote:
>>>>
>>>> It is a *very* bad idea to do any direct operations on the SQL database,
>>>> particularly deleting records.  This is NOT a good solution.
>>>>
>>>> If you need to delete a client, you should do it through some bconsole
>>>> command (other than the sql command) so that all the tables/records that
>>>> are
>>>> connected to a client are also deleted.
>>>>
>>>> Best regards,
>>>>
>>>> Kern
>>>>
>>>>
>>>> On 17.01.2018 10:51, Rolf Halmen wrote:
>>>>
>>>> Hi John,
>>>>
>>>> turns out we're cheating.
>>>>
>>>> mysql -u bacula -p${BACULAMYSQLPW} -e "DELETE FROM Client WHERE
>>>> Name='${FDHOSTNAME}';" bacula
>>>> dbcheck -b -f -y -c /etc/bacula/bacula-dir.conf
>>>>
>>>> So we're just deleting the client, and then let bacula get the database
>>>> back into a consistent state.
>>>>
>>>> Depending on your load and requirements that might not be feasible for
>>>> you, of course.
>>>>
>>>> Kind regards,
>>>> Rolf Halmen
>>>>
>>>>
>>>> On 16.01.2018 17:47, John Naggets wrote:
>>>>
>>>> Hi Rolf,
>>>>
>>>> So if I understand correctly, there is no "standard" procedure or any
>>>> documentation how to properly remove a client once it is not needed
>>>> anymore (e.g. when decomissioning a server)?
>>>>
>>>> If not I would be interested to see your SQL query which you use for
>>>> that purpose.
>>>>
>>>> Indeed I use the "use volume once = true" parameter so that each
>>>> volume contains only one single backup from a client.
>>>>
>>>> Best regards,
>>>> J.
>>>>
>>>> On Mon, Jan 15, 2018 at 4:59 PM, Rolf Halmen
>>>> <rolf.hal...@neubert-consulting.de> wrote:
>>>>
>>>> Hi John,
>>>>
>>>> The database can correlate jobs to volume files.
>>>> I'm not at a workstation right now, but off the top of my head, I'd
>>>> assume
>>>> joining the jobs, media, and clients tables should let you get to the
>>>> list
>>>> of volumes that contain backup-data of the specified client.
>>>>
>>>> Do keep in mind that volume files can contain data from multiple jobs,
>>>> unless "use volume once = true".
>>>>
>>>> Kind regards,
>>>> Rolf
>>>>
>>>> On January 15, 2018 2:10:00 PM UTC, John Naggets
>>>> <hostingnugg...@gmail.com>
>>>> wrote:
>>>>
>>>> Hello,
>>>>
>>>> It happens that some clients on the network get removed and as such do
>>>> not need to be backed up anymore. Now I would like to know what is the
>>>> procedure on the bacula director in order to remove properly and
>>>> entirely a bacula client?
>>>>
>>>> I checked the official documentation but could not find any procedure
>>>> for that purpose.
>>>>
>>>>  From my understanding I need to delete the jobs and files associated
>>>> with them as well as the volumes and finally the physical volumes on
>>>> the filesystem (backups are done on files on a partition of the backup
>>>> server).
>>>>
>>>> My problem here is that the physical volumes on the filesystem all
>>>> have the same label except for the number so how would I know which
>>>> file I can delete?
>>>>
>>>> Thank you in advance for your help.
>>>>
>>>> Best regards,
>>>> John

Regards,
-- 
=========================================================================== 
Heitor Medrado de Faria | EB-1 Visa | LPIC-III | ITIL-F | EMC 05-001| Bacula 
Systems Certified Administrator II 
• Enterprise Bacula does not charge per backup size and has plugins for many 
applications. In the USA: http://bacula.us/ 
• Do you need Bacula training? http://bacula.us/video-classes/ 
• USA +1 (323) 300-5387 | Brazil +55 (61) 98268-4220 | http://bacula.us 
===========================================================================

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to