Add --buffer-size parameter to control buffer size for copy

This commit is contained in:
Nick Craig-Wood
2017-02-14 22:36:37 +00:00
parent 541929258b
commit 493da54113
3 changed files with 19 additions and 4 deletions
+4
View File
@@ -91,6 +91,7 @@ var (
backupDir = StringP("backup-dir", "", "", "Make backups into hierarchy based in DIR.")
suffix = StringP("suffix", "", "", "Suffix for use with --backup-dir.")
bwLimit BwTimetable
bufferSize SizeSuffix = 16 << 20
// Key to use for password en/decryption.
// When nil, no encryption will be used for saving.
@@ -99,6 +100,7 @@ var (
func init() {
VarP(&bwLimit, "bwlimit", "", "Bandwidth limit in kBytes/s, or use suffix b|k|M|G or a full timetable.")
VarP(&bufferSize, "buffer-size", "", "Buffer size when copying files.")
}
// crypt internals
@@ -213,6 +215,7 @@ type ConfigInfo struct {
DataRateUnit string
BackupDir string
Suffix string
BufferSize SizeSuffix
}
// Return the path to the configuration file
@@ -358,6 +361,7 @@ func LoadConfig() {
Config.NoUpdateModTime = *noUpdateModTime
Config.BackupDir = *backupDir
Config.Suffix = *suffix
Config.BufferSize = bufferSize
ConfigPath = *configFile