I am trying to setup a way to watch each file that is created, updated, and deleted through samba. I have currently looked at inotify but I am not sure if that is the best way. What suggestions would you have to setup a way to get some type of event when one of these actions occur? I would like to watch a directory recursively and be able to run a shell script or perl script and that script know the file name and path. Let me know, thanks Clinton Mills
Il giorno lun 02 feb 2009 21:51:13 CET, Clinton Mills ha scritto:> I am trying to setup a way to watch each file that is created, updated, and > deleted through samba. I have currently looked at inotify but I am not sure > if that is the best way. What suggestions would you have to setup a way to > get some type of event when one of these actions occur? I would like to > watch a directory recursively and be able to run a shell script or perl > script and that script know the file name and path.look at this http://us3.samba.org/samba/docs/man/Samba-HOWTO-Collection/VFS.html
Thank you for the information. Is there anyway to run a perl script or shell script when the extd_audit command that sees a log of 0 or 1? Log Level Log Details - File and Directory Operations 0 Make Directory, Remove Directory, Unlink 1 Open Directory, Rename File, Change Permissions/ACLs Then pass the file that was created or unlinked to the script? I know I could watch the log, but I thought there would be a better way. Kind of link how the recycle works. It intercepts the unlink and moves it. I also could just watch for when something was written. That is what I really need. ssize_t skel_write(int fd, char *data, size_t n) { return underlying.write(fd, data, n); } I want the easiest way to do this without having the edit the source code. I am sure someone has done something like this before. Thanks in advance. -----Original Message----- From: samba-bounces+clinton=hitcents.com@lists.samba.org [mailto:samba-bounces+clinton=hitcents.com@lists.samba.org] On Behalf Of Andrea Zagli Sent: Tuesday, February 03, 2009 6:31 AM To: samba@lists.samba.org Subject: Re: [Samba] Files monitoring through Samba Il giorno lun 02 feb 2009 21:51:13 CET, Clinton Mills ha scritto:> I am trying to setup a way to watch each file that is created, updated, and > deleted through samba. I have currently looked at inotify but I am not sure > if that is the best way. What suggestions would you have to setup a way to > get some type of event when one of these actions occur? I would like to > watch a directory recursively and be able to run a shell script or perl > script and that script know the file name and path.look at this http://us3.samba.org/samba/docs/man/Samba-HOWTO-Collection/VFS.html -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
Inotify is your best bet because otherwise you won't see files that are created in any other way except through samba. There's lots of ways files get added, changed, or deleted. inotify catches them all. Of course, you have to combine it with inotifywait and a script for a full solution. -- Eric Robinson -----Original Message----- From: samba-bounces+eric.robinson=psmnv.com@lists.samba.org [mailto:samba-bounces+eric.robinson=psmnv.com@lists.samba.org] On Behalf Of Andrea Zagli Sent: Tuesday, February 03, 2009 4:31 AM To: samba@lists.samba.org Subject: Re: [Samba] Files monitoring through Samba Il giorno lun 02 feb 2009 21:51:13 CET, Clinton Mills ha scritto:> I am trying to setup a way to watch each file that is created, > updated, and deleted through samba. I have currently looked at > inotify but I am not sure if that is the best way. What suggestions > would you have to setup a way to get some type of event when one of > these actions occur? I would like to watch a directory recursively and> be able to run a shell script or perl script and that script know thefile name and path. look at this http://us3.samba.org/samba/docs/man/Samba-HOWTO-Collection/VFS.html -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba Disclaimer - February 3, 2009 This email and any files transmitted with it are confidential and intended solely for samba@lists.samba.org. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of . Warning: Although has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments. This disclaimer was added by Policy Patrol: http://www.policypatrol.com/