From dbf80481344567311dc9ca604e2a99a20d01ed3e Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sat, 16 May 2020 09:02:27 +0300 Subject: [PATCH] app/vmrestore: document better that `vmrestore` works like `rsync --delete`, i.e. it deletes files in `-storageDataPath`, which are missing in the backup --- app/vmrestore/README.md | 9 +++++---- app/vmrestore/main.go | 3 ++- docs/vmrestore.md | 9 +++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/vmrestore/README.md b/app/vmrestore/README.md index d7523bcf1..10c02dfc7 100644 --- a/app/vmrestore/README.md +++ b/app/vmrestore/README.md @@ -21,7 +21,8 @@ vmrestore -src=gcs:/// -storageDataPath=` is the path to folder where data will be restored. This folder must be passed to VictoriaMetrics in `-storageDataPath` command-line flag after the restore process is complete. -The original `-storageDataPath` directory may contain old files. They will be susbstituted by the files from backup. +The original `-storageDataPath` directory may contain old files. They will be susbstituted by the files from backup, +i.e. the end result would be similar to [rsync --delete](https://askubuntu.com/questions/476041/how-do-i-make-rsync-delete-files-that-have-been-deleted-from-the-source-folder). ### Troubleshooting @@ -52,7 +53,7 @@ Run `vmrestore -help` in order to see all the available options: -envflag.prefix string Prefix for environment variables if -envflag.enable is set -fs.disableMmap - Whether to use pread() instead of mmap() for reading data files + Whether to use pread() instead of mmap() for reading data files. By default mmap() is used for 64-bit arches and pread() is used for 32-bit arches, since they cannot data files bigger than 2^32 bytes in memory -loggerFormat string Format for logs. Possible values: default, json (default "default") -loggerLevel string @@ -68,8 +69,8 @@ Run `vmrestore -help` in order to see all the available options: -src string Source path with backup on the remote storage. Example: gcs://bucket/path/to/backup/dir, s3://bucket/path/to/backup/dir or fs:///path/to/local/backup/dir -storageDataPath string - Destination path where backup must be restored. VictoriaMetrics must be stopped when restoring from backup. -storageDataPath dir can be non-empty. In this case only missing data is downloaded from backup (default "victoria-metrics-data") - -version + Destination path where backup must be restored. VictoriaMetrics must be stopped when restoring from backup. -storageDataPath dir can be non-empty. In this case the contents of -storageDataPath dir is synchronized with -src contents, i.e. it works like 'rsync --delete' (default "victoria-metrics-data") + -version Show VictoriaMetrics version ``` diff --git a/app/vmrestore/main.go b/app/vmrestore/main.go index 95b16565a..c91fdefa1 100644 --- a/app/vmrestore/main.go +++ b/app/vmrestore/main.go @@ -16,7 +16,8 @@ var ( src = flag.String("src", "", "Source path with backup on the remote storage. "+ "Example: gcs://bucket/path/to/backup/dir, s3://bucket/path/to/backup/dir or fs:///path/to/local/backup/dir") storageDataPath = flag.String("storageDataPath", "victoria-metrics-data", "Destination path where backup must be restored. "+ - "VictoriaMetrics must be stopped when restoring from backup. -storageDataPath dir can be non-empty. In this case only missing data is downloaded from backup") + "VictoriaMetrics must be stopped when restoring from backup. -storageDataPath dir can be non-empty. In this case the contents of -storageDataPath dir "+ + "is synchronized with -src contents, i.e. it works like 'rsync --delete'") concurrency = flag.Int("concurrency", 10, "The number of concurrent workers. Higher concurrency may reduce restore duration") maxBytesPerSecond = flag.Int("maxBytesPerSecond", 0, "The maximum download speed. There is no limit if it is set to 0") skipBackupCompleteCheck = flag.Bool("skipBackupCompleteCheck", false, "Whether to skip checking for 'backup complete' file in -src. This may be useful for restoring from old backups, which were created without 'backup complete' file") diff --git a/docs/vmrestore.md b/docs/vmrestore.md index d7523bcf1..10c02dfc7 100644 --- a/docs/vmrestore.md +++ b/docs/vmrestore.md @@ -21,7 +21,8 @@ vmrestore -src=gcs:/// -storageDataPath=` is the path to folder where data will be restored. This folder must be passed to VictoriaMetrics in `-storageDataPath` command-line flag after the restore process is complete. -The original `-storageDataPath` directory may contain old files. They will be susbstituted by the files from backup. +The original `-storageDataPath` directory may contain old files. They will be susbstituted by the files from backup, +i.e. the end result would be similar to [rsync --delete](https://askubuntu.com/questions/476041/how-do-i-make-rsync-delete-files-that-have-been-deleted-from-the-source-folder). ### Troubleshooting @@ -52,7 +53,7 @@ Run `vmrestore -help` in order to see all the available options: -envflag.prefix string Prefix for environment variables if -envflag.enable is set -fs.disableMmap - Whether to use pread() instead of mmap() for reading data files + Whether to use pread() instead of mmap() for reading data files. By default mmap() is used for 64-bit arches and pread() is used for 32-bit arches, since they cannot data files bigger than 2^32 bytes in memory -loggerFormat string Format for logs. Possible values: default, json (default "default") -loggerLevel string @@ -68,8 +69,8 @@ Run `vmrestore -help` in order to see all the available options: -src string Source path with backup on the remote storage. Example: gcs://bucket/path/to/backup/dir, s3://bucket/path/to/backup/dir or fs:///path/to/local/backup/dir -storageDataPath string - Destination path where backup must be restored. VictoriaMetrics must be stopped when restoring from backup. -storageDataPath dir can be non-empty. In this case only missing data is downloaded from backup (default "victoria-metrics-data") - -version + Destination path where backup must be restored. VictoriaMetrics must be stopped when restoring from backup. -storageDataPath dir can be non-empty. In this case the contents of -storageDataPath dir is synchronized with -src contents, i.e. it works like 'rsync --delete' (default "victoria-metrics-data") + -version Show VictoriaMetrics version ```