mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
8d9143cbcf
an example for a local printer off a samba server, hp5-redir is for a
remote printer. acct-sum, does the stats from acct-all. There is an
example printcap entry for the redirection of the printer. Lots more
to come!
<pkelly@ets.net>
(This used to be commit 14bae3a0bd
)
30 lines
695 B
Perl
30 lines
695 B
Perl
#!/usr/bin/perl
|
|
|
|
while (<>) {
|
|
($date, $user, $machine, $size, $pages) = split(' ');
|
|
|
|
$Printer{$ARGV}++;
|
|
$PrinterPages{$ARGV} += $pages;
|
|
|
|
$Jobs{$user}++;
|
|
$Size{$user}+= $size;
|
|
$Pages{$user}+= $pages;
|
|
}
|
|
|
|
printf "%-15s %5s %8s %8s\n", qw(User Jobs Pages Size);
|
|
foreach $user (sort keys %Jobs) {
|
|
printf "%-15s %5d %8d %8d \KB\n",
|
|
$user, $Jobs{$user}, $Pages{$user}, $Size{$user}/1024;
|
|
}
|
|
|
|
|
|
print "\n\n";
|
|
printf "%-15s %5s %8s %8s\n", qw(Printer Jobs Pages);
|
|
foreach $prn (sort keys %Printer) {
|
|
($name = $prn) =~ s=.*/==;
|
|
printf "%-15s %5d %8d\n",
|
|
$name, $Printer{$prn}, $PrinterPages{$prn};
|
|
}
|
|
|
|
|