The script is really too heavy and we just need to check if the rsync did add or remove files to avoid execute unuseful occ command.