advice on managing files between two systems

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

I don't know , if I got this correct, but you need to send the modified files and list of deleted files to another machine.

The update/operation on files takes place at 2.00 AM in the morning.Suppose this is script1.

Suppose this operation takes place till 4.00 AM. You can run a script , say script2 which would list the deleted files and the modified files by script1.

Script2 can use find command with atime(or some other) option to find the modified files.These files can be ftp'ied to other machine , say host2.