Holger Parplies wrote at about 02:33:44 +0100 on Friday, December 19, 2008: > Hi, > > Adam Goryachev wrote on 2008-12-19 10:56:44 +1100 [Re: [BackupPC-users] > backuppc 3.0.0: another xfs problem?]: > > I would advise that you confirm whether or not your hard links were > > restored properly: > > cd /var/lib/backuppc/pool/3/3/3 > > for file in `ls` > > Don't you trust shell globbing? ;-) > > > do > > stat $file|grep Links|awk '{print $5" "$6}' > > done > > You mean > > cd /var/lib/backuppc/cpool/3/3/3 > perl -e 'foreach (<*>) { $l {(stat $_) [3]} ++; } > foreach (sort {$a <=> $b} keys %l) { > print "$l{$_} files have $_ links\n"; > }' > > ? ;-)
Although I am in awe of Perl as much as the next guy, I prefer the following to quickly check for files with only 1 link: find /var/lib/backuppc/cpool/3/3/3/ -type f -links 1 ;-) Now Perl shines if you want to tabulate but that was more than the OP was trying to do ;) Although... the following works nicely too (and uses less system & user time on my machine): find /var/lib/backuppc/cpool/3/3/3 -type f -printf "%n\n"| gsl-histogram 1 1000 | awk '{if ($3 > 0) print $1" "$3}' where gsl-histogram is a GNU program that happens to be lying around on my machine.. ------------------------------------------------------------------------------ _______________________________________________ BackupPC-users mailing list BackupPC-users@lists.sourceforge.net List: https://lists.sourceforge.net/lists/listinfo/backuppc-users Wiki: http://backuppc.wiki.sourceforge.net Project: http://backuppc.sourceforge.net/