El Wed, 2 Apr 2008 21:18:33 +0200 BasaBuru <[EMAIL PROTECTED]> escribió:
> El Sábado 29 Marzo 2008 20:39:29 BasaBuru escribió: > > Aupa: > > Lo he conseguido con una maravillosa herramienta que me ha > recomendado un compa del curro. > > incron :: inotify cron system > > This program is an "inotify cron" system. It consists of a daemon and > a table manipulator. You can use it a similar way as the regular > cron. The difference is that the inotify cron handles filesystem > events rather than time periods. > > http://inotify.aiken.cz/ > > Es la bomba...... se puede hacer de todo con ficheros. > > Yo he quedado encantado. > > El demonio esta controlando el directorio que le digas y cuando entra > un fichero (por ejemplo) ejecuta sobre ese fichero el script que > hayas determinado....... en mi caso un simple > chown www-data.www-data. > > Lo docu no me a parecido muy paya pero con las man del programa..... > se pueden hacer birguerias. Y ademas tiene templates para sistemas, > posffix, etc. > > Y ya esta......... toy alucinado de como me he comido la cabeza y lo > fácil que es resolverlo. > > Un saludo > > BasaBuru > Sí, la documentación es escasa y echaba de menos un listado de los eventos que puede manejar incron. Buscando un poco he encontrado en http://lwn.net/Articles/104312/ esto: ======================================================================== -- EVENTS -- IN_ACCESS - Sent when file is accessed. IN_MODIFY - Sent when file is modified. IN_ATTRIB - Sent when file is chmod'ed. IN_CLOSE - Sent when file is closed IN_OPEN - Sent when file is opened. IN_MOVED_FROM - Sent to the source folder of a move. IN_MOVED_TO - Sent to the destination folder of a move. IN_DELETE_SUBDIR - Sent when a sub directory is deleted. (When watching parent) IN_DELETE_FILE - Sent when a file is deleted. (When watching parent) IN_CREATE_SUBDIR - Sent when a sub directory is created. (When watching parent) IN_CREATE_FILE - Sent when a file is created. (When watching parent) IN_DELETE_SELF - Sent when file is deleted. IN_UNMOUNT - Sent when the filesystem is being unmounted. IN_Q_OVERFLOW - Sent when your event queue has over flowed. The MOVED_FROM/MOVED_TO events are always sent in pairs. MOVED_FROM/MOVED_TO is also sent when a file is renamed. The cookie field in the event pairs up MOVED_FROM/MOVED_TO events. These two events are not guaranteed to be successive in the event stream. You must rely on the cookie to pair them up. (Note, the cookie is not sent yet.) If you aren't watching the source and destination folders in a MOVE. You will only get MOVED_TO or MOVED_FROM. In this case, MOVED_TO is equivelent to a CREATE and MOVED_FROM is equivelent to a DELETE. ======================================================================== Espero que sea de ayuda. Saludos -- Manolo Díaz