A feature of iRODS which is very handy when it comes to defining data management policies is the possibility to define system rules that are called each time a given event occurs. An event could be an ingest of a file in given collection or addition of a new user into system. The system rules are defined by the administrator and can be found in server/config/reConfigs/core.re. There are already number of useful examples which can be adjusted to concrete setup.
Let us examine an example of a rule which is called each time a file is ingested into given collection (/tempZone/home/rods/monitored). Each time this happens the collection will be replicated to /targetZone/home/rods/safe-copy by the means of synchronization and writes a message into the server log.
acPostProcForPut{ ON($objPath like "/tempZone/home/rods/monitored/*") { msiSplitPath($objPath,*collection,*fileName); msiCollRsync(*collection,"/targetZone/home/rods/safe-copy","demoResc", "IRODS_TO_IRODS",*Status); writeLine("serverLog", "rsync of *collection to its safe-copy done (status=*Status). Triggered by creation of $objPath"); } }