It obviously depends on what purpose you want your backup to serve.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.
Using --delete keeps your backup the same as the source. Upside is that when you remove files or directories from the source they get removed from the backup, so you backup does not just keep growing in size. Works great for having a backup, that lets you recover from a media crash.
Downside of using --delete is that when you remove files accidently/in error from the source they get removed from your backup during the next backup cycle, so that you will not be able to recover from accident deletions or "rm -r" opps, unless you notice them right away.
My solution is to ensure I am excluding directories with logs and browser cache files (which get large in a hurry) and avoid the use of --delete. I rotate out backup media, so that I get a fresh start every so often. I also run separate backup cycles for OS and data. OS backup is an image/snapshot of the working OS. Data backup is nightly so I have a second copy of all "my stuff".
Statistics: Posted by bjtheone — Mon May 06, 2024 3:24 pm