There is absolutely no danger using --delete when using rsync. The only thing that option does is remove files that are NOT on the source of the rsync operation.Be very careful when using --delete. Getting it wrong could potentially make your OS unbootable. It's not an option I have much experience with.
So if there is nothing on the destination side of the rsync operation (a "new" backup), --delete will do absolutely nothing.
--delete is also required if you want to keep the update synced with rsync. If you remove something from the source side, you also want this to be removed on the destination side.
There are also options for --delete, like --delete-before and --delete-after. The only difference is WHEN the files are deleted, before, during or after the copy operation is done.
Be aware that all delete options will also delete directories, not only files.
Statistics: Posted by bedna — Mon May 06, 2024 6:44 am