Fix texts and comments

This commit is contained in:
DRON-666 2024-04-29 01:18:46 +03:00
parent 0a8f9c5d9c
commit 5703e5a652
5 changed files with 17 additions and 15 deletions

View file

@ -2,21 +2,21 @@ Enhancement: Add options to configure Windows Shadow Copy Service
Restic always used 120 sec. timeout and unconditionally created VSS snapshots Restic always used 120 sec. timeout and unconditionally created VSS snapshots
for all volume mount points on disk. Now this behavior can be fine-tuned by for all volume mount points on disk. Now this behavior can be fine-tuned by
new options, like exclude user specific volumes and mount points or completely new options, like exclude specific volumes and mount points or completely
disable auto snapshotting of volume mount points. disable auto snapshotting of volume mount points.
For example: For example:
restic backup --use-fs-snapshot -o vss.timeout=5m -o vss.excludeallmountpoints=true restic backup --use-fs-snapshot -o vss.timeout=5m -o vss.exclude-all-mount-points=true
changes timeout to five minutes and disable snapshotting of mount points on all volumes, and changes timeout to five minutes and disable snapshotting of mount points on all volumes, and
restic backup --use-fs-snapshot -o vss.excludevolumes="d:\;c:\mnt\;\\?\Volume{e2e0315d-9066-4f97-8343-eb5659b35762}" restic backup --use-fs-snapshot -o vss.exclude-volumes="d:\;c:\mnt\;\\?\Volume{e2e0315d-9066-4f97-8343-eb5659b35762}"
excludes drive `D:`, mount point `C:\MNT` and specific volume from VSS snapshotting. excludes drive `d:`, mount point `c:\mnt` and specific volume from VSS snapshotting.
restic backup --use-fs-snapshot -o vss.provider={b5946137-7b9f-4925-af80-51abd60b20d5} restic backup --use-fs-snapshot -o vss.provider={b5946137-7b9f-4925-af80-51abd60b20d5}
uses 'Microsoft Software Shadow Copy provider 1.0' instead of the default provider. uses 'Microsoft Software Shadow Copy provider 1.0' instead of the default provider.
https://github.com/restic/restic/pull/3067 https://github.com/restic/restic/pull/3067

View file

@ -59,21 +59,21 @@ exclusively locked by another process during the backup.
You can use additional options to change VSS behaviour: You can use additional options to change VSS behaviour:
* ``-o vss.timeout`` specifies timeout for VSS snapshot creation, the default value is 120 seconds * ``-o vss.timeout`` specifies timeout for VSS snapshot creation, the default value is 120 seconds
* ``-o vss.excludeallmountpoints`` disable auto snapshotting of all volume mount points * ``-o vss.exclude-all-mount-points`` disable auto snapshotting of all volume mount points
* ``-o vss.excludevolumes`` allows excluding specific volumes or volume mount points from snapshotting * ``-o vss.exclude-volumes`` allows excluding specific volumes or volume mount points from snapshotting
* ``-o vss.provider`` specifies VSS provider used for snapshotting * ``-o vss.provider`` specifies VSS provider used for snapshotting
E.g., 2.5 minutes timeout with mount points snapshotting disabled can be specified as For example a 2.5 minutes timeout with snapshotting of mount points disabled can be specified as
.. code-block:: console .. code-block:: console
-o vss.timeout=2m30s -o vss.excludeallmountpoints=true -o vss.timeout=2m30s -o vss.exclude-all-mount-points=true
and excluding drive ``D:\``, mount point ``C:\mnt`` and volume ``\\?\Volume{04ce0545-3391-11e0-ba2f-806e6f6e6963}\`` as and excluding drive ``d:\``, mount point ``c:\mnt`` and volume ``\\?\Volume{04ce0545-3391-11e0-ba2f-806e6f6e6963}\`` as
.. code-block:: console .. code-block:: console
-o vss.excludevolumes="d:;c:\MNT\;\\?\volume{04ce0545-3391-11e0-ba2f-806e6f6e6963}" -o vss.exclude-volumes="d:;c:\mnt\;\\?\volume{04ce0545-3391-11e0-ba2f-806e6f6e6963}"
VSS provider can be specified by GUID VSS provider can be specified by GUID

View file

@ -127,10 +127,12 @@ func TestParseMountPoints(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
// We don't know a valid volume GUID path for C:\, but we'll at least check its format // We don't know a valid volume GUID path for c:\, but we'll at least check its format
if !volumeMatch.MatchString(sysVolume) { if !volumeMatch.MatchString(sysVolume) {
t.Fatalf("invalid volume GUID path: %s", sysVolume) t.Fatalf("invalid volume GUID path: %s", sysVolume)
} }
// Changing the case and removing trailing backslash allows tests
// the equality of different ways of writing a volume name
sysVolumeMutated := strings.ToUpper(sysVolume[:len(sysVolume)-1]) sysVolumeMutated := strings.ToUpper(sysVolume[:len(sysVolume)-1])
sysVolumeMatch := strings.ToLower(sysVolume) sysVolumeMatch := strings.ToLower(sysVolume)

View file

@ -33,7 +33,7 @@ func HasSufficientPrivilegesForVSS() error {
return errors.New("VSS snapshots are only supported on windows") return errors.New("VSS snapshots are only supported on windows")
} }
// GetVolumeNameForVolumeMountPoint clear input parameter // GetVolumeNameForVolumeMountPoint add trailing backslash to input parameter
// and calls the equivalent windows api. // and calls the equivalent windows api.
func GetVolumeNameForVolumeMountPoint(mountPoint string) (string, error) { func GetVolumeNameForVolumeMountPoint(mountPoint string) (string, error) {
return mountPoint, nil return mountPoint, nil

View file

@ -828,7 +828,7 @@ func HasSufficientPrivilegesForVSS() error {
return err return err
} }
// GetVolumeNameForVolumeMountPoint clear input parameter // GetVolumeNameForVolumeMountPoint add trailing backslash to input parameter
// and calls the equivalent windows api. // and calls the equivalent windows api.
func GetVolumeNameForVolumeMountPoint(mountPoint string) (string, error) { func GetVolumeNameForVolumeMountPoint(mountPoint string) (string, error) {
if mountPoint != "" && mountPoint[len(mountPoint)-1] != filepath.Separator { if mountPoint != "" && mountPoint[len(mountPoint)-1] != filepath.Separator {