List moved files in text file

Hi.

I am actually doing all of this on OSX, but using unix apps and script.

I have built my own transparent rsync/open directory/mobility/etc set of scripts for the firm I work at, and it is all almost complete except for ONE THING.

I have the classic problem with rsync where if a user deletes or creates a file on their local machine, the machine automagically syncs the files with the server.

If the server has a file that the user does not (e.g. the user deletes it on their local machine) the file the user deletes gets recreated on their machine with my rsync script.

If i use the -delete option with rsync, then I cant do a 2 way sync, as everything on the server in the clients home dir will be deleted if they log in to a new machine.

So.

I have this crazy idea, that I can put a LaunchAgent on the trash directory.

I would like to be able to record to a text file the name (and hopefully path) of any file that is placed in the trash.

Then when the sync script runs, it will first check this text file, and delete any files listed in the text file from the server.

Then, it will sync and be all good and seamless and neat.

Problem is, I am at the limit of my scripting ability.

I guess all I need is some help with how to record the original location and name of whatever file is moved to the trash - in a text file somewhere.

I should be able to handle the rest.

Thanks

-Ash