#!/bin/bash

if [ $# -ne 1 ]; then
	echo "Usage: $0 directory"
	exit
fi

# dac(path([bin]), dir, owner(0), group(0), 
# u(1,1,1), g(1,0,1), o(1,0,1),
# setuid(0), setgid(0), sticky(0))

find $1 | xargs -i /home/chen131/collector/mystat '{}' "file_info(path('%fn'), \
type(%tp), owner(%wn), group(%gp), \
uper(%ur,%uw,%ux), gper(%gr,%gw,%gx), oper(%or,%ow,%ox), \
setuid(%su), setgid(%sg), sticky(%ss), \
se_user('%cu'), se_role('%cr'), se_type('%ct'))."

