I will be using a cronjob to run the script daily.
rsync -parv user@server1:source/ user@server2:destination/The above command will only sync the source folder on server1 to destination folder on server2.
Now on any given day if I delete a huge file from destination folder (as I dont need it anymore) and if the cronjob gets executed, the huge file in source folder will again be copied over to destination.
I need to avoid this. In the above case, the script should delete the huge file from source folder.
I think unison would be helpful here but how to integrate it within a bash script.
Else, how can we do it with rsync itself?
Thanks in advance. .