[Unison-hackers] scriptable triggers

beginthreadex beginthreadex at gmail.com
Thu Dec 31 12:30:27 EST 2009

Enhancement Request:

It would be nice to have options to have files run before the test for a 
file, before the overwrite of a file and after the overwrite of a file.

For instance, I have dynamic content that's currently being created by 
an external process. Getting the timing of this external process and 
unison so I don't have collisions is difficult. I'm processing more 
iterations than needed and I think it could be streamlined. If before 
the check of new content for any file I could have a batch file executed 
then I could create the content at that time. What are really cool time 

Also, if I had the option to do the same after a file was sync-ed then I 
could delete the local file on the server side. The client side would be 
triggered on the new file and could do it's commands then if it needed 
to do something more with the file. When the server reconciled next and 
sent the delete message I would already be done.

For the params to the external file (mine would be bat) it would be nice 
to have these as separate params for easy use:

%1 - action <add, delete, update>
%2 - when <before, after>
%3 - full_path
%4 - path_only (with ending slash)
%5 - filename with extension
%6 - filename only (no extension)
%7 - extension

I think with this, unison could be expanded to be a significant file 
mover between systems. I could sync audio files from one location to 
another and have ID3 tags added. I could detect when a file in a 
significant directory was updated and create a universal gzip of them 
all. I could push raw data from a server dump to a processing server 
that transformed the data to XML and then pushed the content to a 
distribution web server.

More information about the Unison-hackers mailing list