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 GitHub
parent cc908122bd
commit 0f2233aef3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -197,7 +197,7 @@ Therefore, for a complete data **backup**, you need to run the `rsync` command *
```sh ```sh
# example of rsync to remote host # 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. 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 ```sh
# example of rsync from remote backup to local # 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, It is also possible to use **the disk snapshot** in order to perform a backup. This feature could be provided by your operating system,