Post AvYLPVeN3cr34EVUzQ by jcm@snac.bsd.cafe
 (DIR) More posts by jcm@snac.bsd.cafe
 (DIR) Post #AvX5i8hSohgKxxr5Y8 by jcm@snac.bsd.cafe
       2025-06-26T19:59:03Z
       
       0 likes, 0 repeats
       
       Could some kind #FreeBSD / #BSD user show me an invocation of the "mtree" command (and its input file) that allows me to check/update the ownership of specific files inside a nested directory hierarchy ... but where I'm not interested in all files?I /feel/ it should have something to do with the "Full" line type mentioned on https://man.freebsd.org/cgi/man.cgi?query=mtree&sektion=5 ... but I've been unable to get something like this working:#mtreeusr/local/etc/sudoers.d/my-test type=file mode=0440 uname=root gname=rootEven with -e, "mtree -e -p / -f path/to/this/mtree" complains about "usr" not being specified. How can I make mtree not care about directory entries that I /know/ will exist, and only check the specific files I list?
       
 (DIR) Post #AvYLPUJm0imgw3rXFI by TomAoki@mastodon.bsd.cafe
       2025-06-27T09:00:11Z
       
       0 likes, 0 repeats
       
       @jcm FYI: Example use-case of #mtree on #FreeBSD  https://cgit.freebsd.org/src/tree/libexec/rc/rc.d/var#n45This function is called in the script if /var is empty (i.e., fresh installation, volatile such as mfsvar).Note that this script is installed into /etc/rc.d/ on base system installation.And mtree file used is as below (installed into /etc/mtree)  https://cgit.freebsd.org/src/tree/etc/mtree/BSD.var.dist
       
 (DIR) Post #AvYLPVeN3cr34EVUzQ by jcm@snac.bsd.cafe
       2025-06-27T10:32:00Z
       
       0 likes, 0 repeats
       
       Ta - I appreciate the reply 🙂That invocation uses the "-d" flag which, the manpage says, makes the command:-d - Ignore everything except directory type files... which AFAICT is precisely the opposite of the behaviour I need! I'm looking for a way to "ignore everything except file type files", without having to specify directories that I know will already exist ...