I am using rsync to transfer files and sync with remote server, but need to expand on script to check and see if the file exists in another directory on the same remote server, and if it does , do not run rsync command. Would like to program in bash or ksh shell.
If the specific file in the source directory on the target server in
the /n01/uat2/prod11iappl/ilink/11.5.0/processed directory, then I don't need to copy that file - it has already been processed.
If it doesn't exist in that directory, then I need to check if the file exists on the target server in the /n01/uat2/prod11iappl/ilink/11.5.0/incoming directory.
If it doesn't exist in /n01/uat2/prod11iappl/ilink/11.5.0/incoming , then you need to copy that file to that directory.
Here is the rsync command I am using:
rsync -avvvvz -e "ssh -i /home/rsync/.ssh/mesa-rsync-key" /n01/applprod/PROD11i/appl/ilink/11.5.0/processed/TO*.AXML rsync@extapuata: /agile:oaan01/uat2/prod11iappl/ilink/11.5.0/incoming/