Reputation: 41919
I've got mirror sites of code @ 2 locations:
testing & operations
They are each just folders with C# projects in them. I want to make sure that testing always has the latest files, i.e. if operations has a more recent version of a file than testing, then output the stale file to a list.
Concrete Example:
testing has 2 files: file1 & file2
operations has 2 files: file2 & file3
operations has a newer file2 than testing, so output "file2" to a new text file.
How can I do this in Unix?
thanks
Upvotes: 1
Views: 542
Reputation: 71555
If your Unix system has rsync
, you can combine the --dry-run
and --testing
options to tell you what you want to know, I think.
rsync --dry-run --update -aH operations/. testing/.
(Note: For your example, this would also show file3
, since it exists in operations but not testing...)
Upvotes: 2