By default, rsync does not remove files from the destination if they no longer exist at the source. The -delete option removes those files from the destination that do not exist at the source:
$ rsync -avz SOURCE DESTINATION --delete
Linux Shell Scripting Cookbook - Third Edition
by Shantanu Tushar
Published by
Packt Publishing, 2017
By default, rsync does not remove files from the destination if they no longer exist at the source. The -delete option removes those files from the destination that do not exist at the source:
$ rsync -avz SOURCE DESTINATION --delete