#!/bin/bash
cd /var/lib/backuppc/pc
OUT="
Host |
Nb backups |
Before V4 |
After V4 |
"
t_v3=0
t_v4=0
for h in *
do
[ ! -d "$h" -o ! -e "$h/backups" ] && continue
vers=$( cat $h/backups|cut -f24 )
v3=$( echo -e "$vers"|grep -Ev '^4'|wc -l|cut -f1 )
let t_v3=t_v3+v3
[ $v3 -ne 0 ] && v3="$v3"
v4=$( echo -e "$vers"|grep -Ec '^4' )
let t_v4=t_v4+v4
OUT="$OUT$h | $v3 | $v4 |
"
done
[ $t_v3 -gt 0 ] && t_v3="$t_v3"
OUT="$OUT
Total : |
$t_v3 |
$t_v4 |
"
echo $OUT|lynx -stdin