LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Executing a script when uploading a file to a SAMBA SERVER (https://www.linuxquestions.org/questions/linux-server-73/executing-a-script-when-uploading-a-file-to-a-samba-server-614246/)

rafa_gallego 01-17-2008 07:25 AM

Executing a script when uploading a file to a SAMBA SERVER
 
Hi everrybody.

I have set up a samba server with a share to which certain users can upload files. I wonder if it is possible to configure samba in such way that a script is automatically executed when an user uploads a file to the server. This script would have validation purposes such that check the file format, its size and name, etc.

allend 01-17-2008 08:44 AM

I do not know any way that Samba could be configured, but you could set up a cron job to run at a regular interval. The script could look for any new files in your Samba share and conduct your checks.

rafa_gallego 01-17-2008 08:51 AM

Quote:

Originally Posted by allend (Post 3025843)
I do not know any way that Samba could be configured, but you could set up a cron job to run at a regular interval. The script could look for any new files in your Samba share and conduct your checks.

Thanks, this is in fact what I have been doing, but I am looking for a better solution. When a user uploads a wrong file to the share, I want the system to act on it inmediately without waiting for a job depending on the cron daemon.

Thanks for your reply.

chrism01 01-17-2008 05:48 PM

Try inotify eg http://www-128.ibm.com/developerwork...l-inotify.html

rafa_gallego 01-18-2008 05:39 AM

Quote:

Originally Posted by chrism01 (Post 3026388)

Thankx a lot!!! Inotify is a very powerful piece of sofware that suits me perfectly. I am using the inotify cron system (incron).

Rafa


All times are GMT -5. The time now is 08:37 AM.