Is it possible to use the diff command to compare two directories on different Unix (AIX) servers?
We have two regions set up and we want to be able to compare if the scripts directory in both regions contain the same files?
I want to figure out if its possible.. Have been messing around by dumping the listing of each dir into separate files and comparing them with diff.. But that doesn't work the way i need it to..
Is there any other command out there that could work?
Thanks,
Jaz
EDIT**
Can something like this work?? I've tried it from the command line but it gives the following error.
don't understand your command, there is no command follow by -exec, if the missed command is ls, then you needn't -exec, use -print (or not, -print is default for find) will export the file list.
Because there is no command for -exec, I don't understand what you sort for.
diff <(ssh server_name 'find directory_to_compare -type f | sort') <(ssh server_name 'find directory_to_compare -type f | sort')
---------- Post updated at 09:37 PM ---------- Previous update was at 04:45 AM ----------
Would it be possible to use the "rsync --dry-run" option to find differences in directories on separate servers.. Only just come across the command and not sure how it works.. The man pages are pretty long.. When comparing the directories can the command work over ssh? I'm can't get my head around how the command works...
No, the syntax is correct with the <(..) constructs. Jazzmania, my guess would be that you are running ksh88 on the system you are firing the command from. What happens if you run this:
(echo ${.sh.version}) 2>&- || echo ksh88
Perhaps /bin/ksh93 is present on your system too. If so try start up that shell and try running the command from there.
Almost have this working... having a problem getting the ssh key to work this way tho.. Also getting the message "unexpected EOF in read_timeout" Think this error is more to do with ssh tho..
Not sure where to go from here.. I mean am I tackling the issue from the wrong direction.. Is there some other way of comparing directories that reside on different unix servers another way?