Re: [Bacula-users] Procedure to remove properly client

2018-01-21 Thread John Naggets
Hi Heitor As suggested I ran a "list jobs client=old-fd" in order to delete all jobs associated with that old client. Then I ran the dbcheck -b and dbcheck -f but still there is the same amount of volume files saved on my disk which contains the backups. So I deduct here that none of the above

Re: [Bacula-users] Procedure to remove properly client

2018-01-20 Thread Heitor Faria
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 >

Re: [Bacula-users] Procedure to remove properly client

2018-01-20 Thread John Naggets
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

Re: [Bacula-users] Procedure to remove properly client

2018-01-20 Thread Kern Sibbald
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

Re: [Bacula-users] Procedure to remove properly client

2018-01-19 Thread John Naggets
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

Re: [Bacula-users] Procedure to remove properly client

2018-01-19 Thread Kern Sibbald
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

Re: [Bacula-users] Procedure to remove properly client

2018-01-17 Thread Rolf Halmen
Hi John, that's a bit trickier, and I don't have code for that, but I've seen it done. After doing the database bit, you can do something like this: foreach (volume-file); do     if (file not listed in database); then         delete     else         keep I wouldn't call it elegant, but it

Re: [Bacula-users] Procedure to remove properly client

2018-01-17 Thread John Naggets
Thanks Rolf for the details and SQL query you use for that purpose. I am currently testing this out. By the way there is no "-y" option on my Bacula version (7.4.4) so I used use "-v" for verbose instead. I suppose this takes quite some time as I have quite a few clients and it''s still running.

Re: [Bacula-users] Procedure to remove properly client

2018-01-17 Thread Rolf Halmen
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

Re: [Bacula-users] Procedure to remove properly client

2018-01-16 Thread John Naggets
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

Re: [Bacula-users] Procedure to remove properly client

2018-01-15 Thread Rolf Halmen
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