File tree 2 files changed +8
-9
lines changed
2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,10 @@ import (
14
14
"github.com/urfave/cli"
15
15
)
16
16
17
- const BackupTimeFormat = "2006-01-02T15-04-05"
17
+ const (
18
+ BackupTimeFormat = "2006-01-02T15-04-05"
19
+ defaultConfigPath = "/etc/clickhouse-backup/config.yml"
20
+ )
18
21
19
22
var (
20
23
version = "unknown"
24
27
ErrUnknownClickhouseDataPath = errors .New ("clickhouse data path is unknown, you can set data_path in config file" )
25
28
)
26
29
27
- const (
28
- defaultConfigPath = "/etc/clickhouse-backup/config.yml"
29
- )
30
-
31
30
func main () {
32
31
log .SetOutput (os .Stdout )
33
32
cliapp := cli .NewApp ()
Original file line number Diff line number Diff line change @@ -237,18 +237,18 @@ func (s *S3) UploadDirectory(localPath string, dstPath string) error {
237
237
}
238
238
239
239
// UploadFile - synchronize localPath to dstPath on s3
240
- func (s * S3 ) UploadFile (config * Config , localPath string , dstPath string ) error {
240
+ func (s * S3 ) UploadFile (localPath string , dstPath string ) error {
241
241
uploader := s3manager .NewUploader (s .session )
242
- uploader .PartSize = config . S3 .PartSize
242
+ uploader .PartSize = s . Config .PartSize
243
243
244
244
file , err := os .Open (localPath )
245
245
if err != nil {
246
246
return fmt .Errorf ("error opening file %v: %v" , localPath , err )
247
247
}
248
248
if ! s .DryRun {
249
249
if _ , err := uploader .UploadWithContext (aws .BackgroundContext (), & s3manager.UploadInput {
250
- ACL : aws .String (config . S3 .ACL ),
251
- Bucket : aws .String (config . S3 .Bucket ),
250
+ ACL : aws .String (s . Config .ACL ),
251
+ Bucket : aws .String (s . Config .Bucket ),
252
252
Key : aws .String (path .Join (s .Config .Path , dstPath )),
253
253
Body : file ,
254
254
}); err != nil {
You can’t perform that action at this time.
0 commit comments