I am looking for some guidance to see if this is the most efficient solution.
I have a piece of software that updates a directory every night at 2am. The directory contains xml files so at 2am any new files are written, any modified files are modified and any deleted files are removed from the directory.
I need to send new and modified files to a different system. I also need to send a list of deleted files.
I had thought about using rsynch but the system I am feeding doesn't want to upload all files every day as it is a drain. That is why they want new/amended files only and a list of deleted files.
Here's my plan;
- directory on main server (let's call is 'a') is refreshed at 2.00am
- i can run rscnch on 'a' and a new folder 'b' at 4.00am
- between 2.00am and 4.00am folder 'a' and 'b' will be different.
- at 2.30am i can run a chron job on directory 'a' to send the new/amended files to the other system.
- at 3.00am i can run a script to cmpare the difference between 'a' and 'b' and output a list of files that are in 'b' but not 'a'. this can then be sent to the other system.
It seems a bit long winded but I am not aware of another way to do this. Does anyone have any suggestions for a better approach?
Thanks