Deleted Files Report

Status
Not open for further replies.

Fabio Rodrigues

Dabbler
Joined
Oct 20, 2016
Messages
40
I would like to create a weekly report that lists the deleted files in a FreeNAS share. What would be the best way to do that? Run "diff" between the volume and a snapshot? Any suggestions?
 

Fabio Rodrigues

Dabbler
Joined
Oct 20, 2016
Messages
40
Post contents of /usr/local/etc/smb4.conf
This is the share I'm trying to configure VFS:
Code:
[Images]
	path = /mnt/volume1/dataset1
	printable = no
	veto files = /.snapshot/.windows/.mac/.zfs/
	writeable = yes
	browseable = yes
	vfs objects = zfs_space zfsacl full_audit aio_pthread
	hide dot files = yes
	guest ok = no
	nfs4:mode = special
	nfs4:acedup = merge
	nfs4:chown = true
	zfsacl:acesort = dontcare
	full_audit:success = unlink
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
This is the share I'm trying to configure VFS:
Code:
[Images]
	path = /mnt/volume1/dataset1
	printable = no
	veto files = /.snapshot/.windows/.mac/.zfs/
	writeable = yes
	browseable = yes
	vfs objects = zfs_space zfsacl full_audit aio_pthread
	hide dot files = yes
	guest ok = no
	nfs4:mode = special
	nfs4:acedup = merge
	nfs4:chown = true
	zfsacl:acesort = dontcare
	full_audit:success = unlink

full_audit:failure defaults to "ALL". This means that with your above setup, samba will log all failed VFS operations. Try adding something like full_audit:failure = unlink.
 

Fabio Rodrigues

Dabbler
Joined
Oct 20, 2016
Messages
40
full_audit:failure defaults to "ALL". This means that with your above setup, samba will log all failed VFS operations. Try adding something like full_audit:failure = unlink.
Thanks anodos, that works!
What about the format of the entry in the log, is it possible to add the full path to the file that was deleted? Right now I'm seeing something like that:

Code:
Jul 25 15:15:05 freenas smbd_audit: domain\username|1.2.3.4|unlink|ok|Tulips.jpg
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Check out the "Variable Substitutions" section of the smb.conf manpage. For example, full_audit:prefix = "%u|%I|%P". I'm not sure if %P will give you what you want (it's the path to the root directory of the current service, i.e. share). Perhaps "%u|%I|%$(path)". I personally don't use full_audit and so I don't know the details of how to achieve this. :)
 
Status
Not open for further replies.
Top