chmod 700 /var/spool/bweb
chown www-data /var/spool/bweb
+You have to remove "<!-- Remove this to activate bfileview" and "-->" from
+tpl/display_job_zoom.tpl.
+
You must use brestore.pl -b to initialise the database, and
you can use bfileview.pl mode=batch jobid=xxx where=/ to compute tree size.
-At this time, it's a good idea to schedule brestore.pl -g after your
+At this time, it's a good idea to schedule brestore.pl -b after your
BackupCatalog job.
Job {
#
use strict;
+use POSIX qw/strftime/;
use Bweb;
use CCircle ;
use Digest::MD5 qw(md5_hex);
my $base_url = '/bweb/fv' ;
my $base_fich = $conf->{fv_write_path};
-die "Can't get where" unless ($where and $jobid);
-
-if ($batch eq 'batch') {
+if ($where and $jobid and $batch eq 'batch') {
my $root = fv_get_root_pathid($where);
if ($root) {
fv_compute_size($jobid, $root);
$bweb->display_begin();
$bweb->display_job_zoom($jobid);
+unless ($where and $jobid) {
+ $bweb->error("Can't get where or jobid");
+ exit 0;
+}
+
+unless (-w $base_fich) {
+ $bweb->error("$base_fich is not writable");
+ exit 0;
+}
+
if (-f "$base_fich/$md5_rep.png" and -f "$base_fich/$md5_rep.tpl")
{
$bweb->display({}, "$base_fich/$md5_rep.tpl");
my $path = $bweb->dbh_quote(dirname($full_name) . "/");
my $attr = $bweb->dbh_selectrow_hashref("
- SELECT 1 AS found,
- base64_decode_lstat(8, lstat) AS size
+ SELECT 1 AS found,
+ MD5 AS md5,
+ base64_decode_lstat(8, LStat) AS size,
+ base64_decode_lstat(11, LStat) AS atime,
+ base64_decode_lstat(12, LStat) AS mtime,
+ base64_decode_lstat(13, LStat) AS ctime
+
FROM File INNER JOIN Filename USING (FilenameId)
INNER JOIN Path USING (PathId)
WHERE Name = $filename
$attr->{filename} = $full_name;
$attr->{size} = Bweb::human_size($attr->{size});
+ foreach my $d (qw/atime ctime mtime/) {
+ $attr->{$d} = strftime('%F %H:%M', localtime($attr->{$d}));
+ }
return $attr;
}
my ($jobid, $rep) = @_;
my $ret = $bweb->dbh_selectrow_hashref("
- SELECT sum(base64_decode_lstat(8,lstat)) AS size
+ SELECT sum(base64_decode_lstat(8,LStat)) AS size
FROM File
WHERE PathId = $rep
AND JobId = $jobid
my $ret = $bweb->dbh_selectall_arrayref("
SELECT Name, size
FROM (
- SELECT FilenameId,base64_decode_lstat(8,lstat) AS size
+ SELECT FilenameId,base64_decode_lstat(8,LStat) AS size
FROM File
WHERE PathId = $rep
AND JobId = $jobid
<input type='hidden' name='jobid' value='<TMPL_VAR jobid>'>
<input type='hidden' name='where' value='/'>
<label>
- <input type="image" name='action' value='bfileview' title="Voir la répartition des fichiers"
+ <input type="image" name='action' value='bfileview'
+ title="Voir la répartition des fichiers"
+ onclick='if (<TMPL_VAR JobFiles> > 5000) { return confirm("Ce traitement peut prendre beaucoup de temps, voulez vous continuer ?")} else { return 1; }'
src='/bweb/colorscm.png'> Voir la répartition des fichiers
</label>
</form>
-Filename : <TMPL_VAR filename><br/>
-Size : <TMPL_VAR size><br/>
+<div class='titlediv'>
+ <h1 class='newstitle'> Informations sur <TMPL_VAR filename> </h1>
+</div>
+<div class='bodydiv'>
+ <table>
+ <tr><td>taille : </td> <td> <TMPL_VAR size> </td></tr>
+ <tr><td>ctime : </td> <td> <TMPL_VAR atime> </td></tr>
+ <tr><td>mtime : </td> <td> <TMPL_VAR mtime> </td></tr>
+ <tr><td>atime : </td> <td> <TMPL_VAR atime> </td></tr>
+ <tr><td>md5 : </td> <td> <TMPL_VAR md5> </td></tr>
+ </table>
+</div>
Require valid-user
</Directory>
+Alias /bweb/fv /var/spool/bweb
+<Directory "/var/spool/bweb">
+ Options None
+ AllowOverride AuthConfig
+ Order allow,deny
+ Allow from all
+</Directory>
+
Alias /bweb /usr/share/bweb/html
<Directory "/usr/share/bweb/html">
Options None
Order allow,deny
Allow from all
</Directory>
+
</label>
</form>
</td>
-<!-- Remove this to enable fileview
+<!-- Remove this to activate bfileview
<td>
<form action='bfileview.pl?'>
<input type='hidden' name='jobid' value='<TMPL_VAR jobid>'>
<input type='hidden' name='where' value='/'>
<label>
<input type="image" name='action' value='bfileview' title='view file usage'
- src='/bweb/colorscm.png'> View file usage
+ src='/bweb/colorscm.png' onclick='if (<TMPL_VAR JobFiles> > 5000) { return confirm("It could take long time, do you want to continue ?")} else { return 1; }'> View file usage
</label>
</form>
</td>
-Filename : <TMPL_VAR filename><br/>
-Size : <TMPL_VAR size><br/>
+<div class='titlediv'>
+ <h1 class='newstitle'> Informations about <TMPL_VAR filename> </h1>
+</div>
+<div class='bodydiv'>
+ <table>
+ <tr><td>size : </td> <td> <TMPL_VAR size> </td></tr>
+ <tr><td>ctime :</td> <td> <TMPL_VAR atime> </td></tr>
+ <tr><td>mtime :</td> <td> <TMPL_VAR mtime> </td></tr>
+ <tr><td>atime :</td> <td> <TMPL_VAR atime> </td></tr>
+ <tr><td>md5 : </td> <td> <TMPL_VAR md5> </td></tr>
+ </table>
+</div>