Implement --backup-dir - fixes #98

The parameter of backup-dir specifies a remote that all deleted or
overwritten files will be copied to.
This commit is contained in:
ncw
2017-01-16 17:33:25 +00:00
committed by Nick Craig-Wood
parent c123c702ab
commit 3745c526f1
6 changed files with 165 additions and 27 deletions
+3
View File
@@ -86,6 +86,7 @@ var (
ignoreSize = BoolP("ignore-size", "", false, "Ignore size when skipping use mod-time or checksum.")
noTraverse = BoolP("no-traverse", "", false, "Don't traverse destination file system on copy.")
noUpdateModTime = BoolP("no-update-modtime", "", false, "Don't update destination mod-time if files identical.")
backupDir = StringP("backup-dir", "", "", "Make backups into hierarchy based in DIR.")
bwLimit BwTimetable
// Key to use for password en/decryption.
@@ -209,6 +210,7 @@ type ConfigInfo struct {
NoTraverse bool
NoUpdateModTime bool
DataRateUnit string
BackupDir string
}
// Find the config directory
@@ -260,6 +262,7 @@ func LoadConfig() {
Config.IgnoreSize = *ignoreSize
Config.NoTraverse = *noTraverse
Config.NoUpdateModTime = *noUpdateModTime
Config.BackupDir = *backupDir
ConfigPath = *configFile