Add --delete option to rsync command, so it removes non-existing files from the destination

- The --delete option is needed to be passed to rsync during backups,
Since otherwise the backup may contain superfluous files after the second run of rsync,
because these files can be already removed at the source because of background merge

- the --delete option is needed when restoring from backup in order to remove superfluous files
from the destination directory. Otherwise these files may lead to inconsistent data at VictoriaLogs.
This commit is contained in:
Aliaksandr Valialkin 2024-11-10 10:10:29 +02:00 committed by f41gh7
parent 50d9804df6
commit ad55eb29dd
No known key found for this signature in database
GPG Key ID: 4558311CF775EC72

View File

@ -197,7 +197,7 @@ Therefore, for a complete data **backup**, you need to run the `rsync` command *
```sh
# example of rsync to remote host
rsync -avh --progress <path-to-victorialogs-data> <username>@<host>:<path-to-victorialogs-backup>
rsync -avh --progress --delete <path-to-victorialogs-data> <username>@<host>:<path-to-victorialogs-backup>
```
The first `rsync` will sync the majority of the data, which can be time-consuming.
@ -227,7 +227,7 @@ VictoriaLogs will automatically load this data upon startup.
```sh
# example of rsync from remote backup to local
rsync -avh --progress <username>@<host>:<path-to-victorialogs-backup> <path-to-victorialogs-data>
rsync -avh --progress --delete <username>@<host>:<path-to-victorialogs-backup> <path-to-victorialogs-data>
```
It is also possible to use **the disk snapshot** in order to perform a backup. This feature could be provided by your operating system,