Skip to content

Commit 1b2d07b

Browse files
committed
added the option to change the part size
1 parent 9cb902e commit 1b2d07b

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

backup/s3.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func InitializeS3Session() {
103103
})
104104

105105
uploader := manager.NewUploader(client, func(u *manager.Uploader) {
106-
u.PartSize = 64 * 1024 * 1024
106+
u.PartSize = config.Parameters.PartSize * 1024 * 1024
107107
u.Concurrency = 10
108108
})
109109

config/config.sample.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ backupAsTables: false # Backup MySQL databases as tables
1616
removeLocal: true
1717
archivePass: # Password for encrypting backups. No encryption if empty
1818
retry: false
19+
partSize: 64
1920
rotation:
2021
enabled: true
2122
period: week # week or month - week db-week_1.sql.7z .. db-week_52.sql.7z - month db-january.sql.7z .. db-december.sql.7z

config/params.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type Params struct {
2424
RunEveryCron string
2525
BackupType BackupType
2626
Retry bool
27+
PartSize int64
2728
Notify struct {
2829
UptimeAlarm bool
2930
UptimeStartLimit int
@@ -182,5 +183,8 @@ func ParseParams(configFile *string) {
182183

183184
decodeB64Vars()
184185

186+
if Parameters.PartSize == 0 {
187+
Parameters.PartSize = 64
188+
}
185189
Parameters.Fqdn, _ = os.Hostname()
186190
}

0 commit comments

Comments
 (0)