Skip to content

Commit

Permalink
Support Volume Shadow Copy service for Windows/Mac Platforms
Browse files Browse the repository at this point in the history
Allow "vss:true" in "storage" section to support -vss qualifier
in duplicacy (Volume Shadow Copy Service).

Note that this is primarily a Windows feature, although support
has been committed for Mac OS/X as well on APFS volumes.

This fixes issue #2 (feature request).
  • Loading branch information
jeffaco committed Jul 15, 2018
1 parent 397bc67 commit 4aa94bc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ Field Name | Purpose | Required | Default Value
---------- | ------- | -------- | -------------
name | Storage name to back up | Yes | None
threads | Number of threads to use for backup | No | 1
vss | Enable Volume Shadow Copy service | No | false

Fields in the `copy` section (if one exists), are:

Expand Down
7 changes: 7 additions & 0 deletions configBackup.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ func (config *ConfigFile) LoadConfig(verboseFlag bool, debugFlag bool) error {
} else {
storageMap["threads"] = "1"
}
// Default to vss:false if not otherwise specified
vssFlag := v.GetBool(key + ".vss")
if vssFlag {
storageMap["vss"] = "true"
} else {
storageMap["vss"] = "false"
}
config.backupInfo = append(config.backupInfo, storageMap)
} else {
break
Expand Down
10 changes: 8 additions & 2 deletions duplicacy-util.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,14 @@ func performBackup() error {
backupStartTime := time.Now()
logger.Println("######################################################################")
cmdArgs := []string{"backup", "-storage", configFile.backupInfo[i]["name"], "-threads", configFile.backupInfo[i]["threads"], "-stats"}
logMessage(logger, fmt.Sprint("Backing up to storage ", configFile.backupInfo[i]["name"],
" with ", configFile.backupInfo[i]["threads"], " threads"))
if configFile.backupInfo[i]["vss"] == "true" {
cmdArgs = append(cmdArgs, "-vss")
logMessage(logger, fmt.Sprint("Backing up to storage ", configFile.backupInfo[i]["name"],
" -vss with ", configFile.backupInfo[i]["threads"], " threads"))
} else {
logMessage(logger, fmt.Sprint("Backing up to storage ", configFile.backupInfo[i]["name"],
" with ", configFile.backupInfo[i]["threads"], " threads"))
}
if debugFlag {
logMessage(logger, fmt.Sprint("Executing: ", duplicacyPath, cmdArgs))
}
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

VERSION=1.1
VERSION=1.2

0 comments on commit 4aa94bc

Please sign in to comment.