Bacula-users

Re: [Bacula-users] file listing?

2011-03-09 17:39:17
Subject: Re: [Bacula-users] file listing?
From: ganiuszka <ganiuszka AT gmail DOT com>
To: Mike Eggleston <mikeegg1 AT mac DOT com>
Date: Wed, 9 Mar 2011 23:36:00 +0100
Hi,
Here you have SQL function for PostgreSQL (I took it from bweb):

CREATE PROCEDURAL LANGUAGE plpgsql;
BEGIN;

CREATE OR REPLACE FUNCTION base64_decode_lstat(int4, varchar) RETURNS int8 AS $$
DECLARE
val int8;
b64 varchar(64);
size varchar(64);
i int;
BEGIN
size := split_part($2, ' ', $1);
b64 := 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
val := 0;
FOR i IN 1..length(size) LOOP
val := val + (strpos(b64, substr(size, i, 1))-1) * (64^(length(size)-i));
END LOOP;
RETURN val;
END;
$$ language 'plpgsql';

COMMIT;

and this is a query which lists file path, filename and size in Bytes
(in this example for jobid=8):

SELECT Path.Path, Filename.Name, base64_decode_lstat(8,File.LStat) AS
size FROM Filename, File, Path WHERE File.JobId=8 AND
File.PathId=Path.PathId AND Filename.FilenameId=File.FilenameId ORDER
BY size ASC;

I tested it. It works.

Regards
gani

2011/3/9 Mike Eggleston <mikeegg1 AT mac DOT com>:
> Afternoon,
>
> I just noticed one of my clients had a huge incremental (level 2)
> backup. I want to see what file caused the huge increase. I tried 'list
> files jobid=20097' and though I'm shown the files, I'm not shown the
> size of each file. Is there a command or query that shows me the size
> of the file?
>
> Mike

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users